yzh
2022-05-19 318d349fc009011a135dbce5a25e392b492c0718
客户分配个性产品
系统数据权限隔离
47个文件已修改
782 ■■■■■ 已修改文件
web/.vs/Web/v16/.suo 补丁 | 查看 | 原始文档 | blame | 历史
web/App_Code/bin/Debug/App_Code.dll 补丁 | 查看 | 原始文档 | blame | 历史
web/App_Code/bin/Debug/App_Code.pdb 补丁 | 查看 | 原始文档 | blame | 历史
web/App_Code/obj/Debug/App_Code.csproj.CoreCompileInputs.cache 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/App_Code/obj/Debug/App_Code.csproj.FileListAbsolute.txt 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/App_Code/obj/Debug/App_Code.dll 补丁 | 查看 | 原始文档 | blame | 历史
web/App_Code/obj/Debug/App_Code.pdb 补丁 | 查看 | 原始文档 | blame | 历史
web/Dao/GwClientDao.cs 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/Dao/GwOrderDao.cs 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/Dao/GwProductDao.cs 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/Dao/GwSpDao.cs 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/Dao/obj/Debug/Dao.csproj.AssemblyReference.cache 补丁 | 查看 | 原始文档 | blame | 历史
web/Dao/obj/Debug/Dao.dll 补丁 | 查看 | 原始文档 | blame | 历史
web/Dao/obj/Debug/Dao.pdb 补丁 | 查看 | 原始文档 | blame | 历史
web/Lib/Dao.dll 补丁 | 查看 | 原始文档 | blame | 历史
web/Lib/Dao.pdb 补丁 | 查看 | 原始文档 | blame | 历史
web/Lib/Model.dll 补丁 | 查看 | 原始文档 | blame | 历史
web/Lib/Model.pdb 补丁 | 查看 | 原始文档 | blame | 历史
web/Model/Model/GwProduct.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/Model/obj/Debug/Model.csproj.AssemblyReference.cache 补丁 | 查看 | 原始文档 | blame | 历史
web/Model/obj/Debug/Model.dll 补丁 | 查看 | 原始文档 | blame | 历史
web/Model/obj/Debug/Model.pdb 补丁 | 查看 | 原始文档 | blame | 历史
web/UMCLib/bin/Debug/UMCLib.dll 补丁 | 查看 | 原始文档 | blame | 历史
web/UMCLib/bin/Debug/UMCLib.pdb 补丁 | 查看 | 原始文档 | blame | 历史
web/UMCLib/obj/Debug/UMCLib.csproj.CoreCompileInputs.cache 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/UMCLib/obj/Debug/UMCLib.csproj.FileListAbsolute.txt 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/UMCLib/obj/Debug/UMCLib.dll 补丁 | 查看 | 原始文档 | blame | 历史
web/UMCLib/obj/Debug/UMCLib.pdb 补丁 | 查看 | 原始文档 | blame | 历史
web/web/Bin/App_Code.dll 补丁 | 查看 | 原始文档 | blame | 历史
web/web/Bin/App_Code.pdb 补丁 | 查看 | 原始文档 | blame | 历史
web/web/Bin/Dao.dll 补丁 | 查看 | 原始文档 | blame | 历史
web/web/Bin/Dao.pdb 补丁 | 查看 | 原始文档 | blame | 历史
web/web/Bin/Model.dll 补丁 | 查看 | 原始文档 | blame | 历史
web/web/Bin/Model.pdb 补丁 | 查看 | 原始文档 | blame | 历史
web/web/Bin/UMCLib.pdb 补丁 | 查看 | 原始文档 | blame | 历史
web/web/ExportDocument.aspx.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/web/GwClient.ashx 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/web/GwClient.aspx 94 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/web/GwClient.aspx.cs 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/web/GwOrder.ashx 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/web/GwOrderAudit.aspx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/web/GwOrderComplete.aspx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/web/GwSm.aspx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/web/GwSmResend.aspx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/web/GwSp.ashx 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/web/Setting.aspx 417 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/web/gwspupdate.aspx.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/.vs/Web/v16/.suo
Binary files differ
web/App_Code/bin/Debug/App_Code.dll
Binary files differ
web/App_Code/bin/Debug/App_Code.pdb
Binary files differ
web/App_Code/obj/Debug/App_Code.csproj.CoreCompileInputs.cache
@@ -1 +1 @@
73d59a519d75fba02045f94dbe09df43d113619d
148a124d533dab517de60d4081ee6b355ffb0769
web/App_Code/obj/Debug/App_Code.csproj.FileListAbsolute.txt
@@ -8,3 +8,13 @@
D:\Company\SMGW_NewWeb\web\App_Code\obj\Debug\App_Code.csproj.CopyComplete
D:\Company\SMGW_NewWeb\web\App_Code\obj\Debug\App_Code.dll
D:\Company\SMGW_NewWeb\web\App_Code\obj\Debug\App_Code.pdb
C:\AYZH\work\Git_Rep\SMGW_NewWeb\web\App_Code\bin\Debug\App_Code.dll
C:\AYZH\work\Git_Rep\SMGW_NewWeb\web\App_Code\bin\Debug\App_Code.pdb
C:\AYZH\work\Git_Rep\SMGW_NewWeb\web\App_Code\bin\Debug\Aspose.Cells.dll
C:\AYZH\work\Git_Rep\SMGW_NewWeb\web\App_Code\bin\Debug\Dao.dll
C:\AYZH\work\Git_Rep\SMGW_NewWeb\web\App_Code\bin\Debug\Ionic.Zip.dll
C:\AYZH\work\Git_Rep\SMGW_NewWeb\web\App_Code\obj\Debug\App_Code.csproj.AssemblyReference.cache
C:\AYZH\work\Git_Rep\SMGW_NewWeb\web\App_Code\obj\Debug\App_Code.csproj.CoreCompileInputs.cache
C:\AYZH\work\Git_Rep\SMGW_NewWeb\web\App_Code\obj\Debug\App_Code.csproj.CopyComplete
C:\AYZH\work\Git_Rep\SMGW_NewWeb\web\App_Code\obj\Debug\App_Code.dll
C:\AYZH\work\Git_Rep\SMGW_NewWeb\web\App_Code\obj\Debug\App_Code.pdb
web/App_Code/obj/Debug/App_Code.dll
Binary files differ
web/App_Code/obj/Debug/App_Code.pdb
Binary files differ
web/Dao/GwClientDao.cs
@@ -25,7 +25,7 @@
        /// <param name="agent">业务员</param>
        /// <returns></returns>
        //public List<GwClient> LoadInfoList(out int recordCount, int pageIndex, int pageSizestring, string clientID, string clientName, string telphone, string agent)
        public List<GwClient> LoadInfoList(out int recordCount, int pageIndex, int pageSizestring, string clientID, string clientName, string telphone, string agent, string company, string salesman, string productId)
        public List<GwClient> LoadInfoList(out int recordCount, int pageIndex, int pageSizestring, string clientID, string clientName, string telphone, string agent, string company, string salesman, string productId, string permissionsSQL )
        {
            List<GwClient> list = new List<GwClient>();
@@ -34,7 +34,7 @@
            {
                StringBuilder stringBuilder = new StringBuilder();
                stringBuilder.Append("from GW_CLIENT where 1=1");
                OracleParameter[] oracleParameterArray = new OracleParameter[4];
                OracleParameter[] oracleParameterArray = new OracleParameter[6];
                if (clientID != null && clientID != "")
                {
                    oracleParameterArray[0] = new OracleParameter(":ClientID", (OracleDbType)126);
@@ -61,7 +61,7 @@
                }
                if (salesman != null && salesman != "")
                {
                    oracleParameterArray[4] = new OracleParameter(":Salesman", (OracleDbType)112);
                    oracleParameterArray[4] = new OracleParameter(":Salesman", (OracleDbType)126);
                    ((DbParameter)oracleParameterArray[4]).Value = (object)( salesman );
                    stringBuilder.Append(" and Salesman = :Salesman");
                }
@@ -76,6 +76,9 @@
                {
                    stringBuilder.Append(" and CLIENT_ID IN ( SELECT distinct CLIENT_ID  FROM GW_SP WHERE PRODUCT_ID = '" + productId + "' )");
                }
                //客户权限SQL脚本
                stringBuilder.Append(permissionsSQL);
                stringBuilder.Append(" order by CREATE_TIME DESC,CLIENT_ID DESC");
                using (OracleDataReader reader = OracleHelper.ExecuteReader("select count(*) as count " + stringBuilder.ToString(), OracleHelper.Connection, oracleParameterArray))
@@ -100,6 +103,10 @@
            }
            return list;
        }
        /**
         * 查询统计功能
         */
        public List<GwClient> LoadInfoList(string clientID, string clientName, string company, string agent)
        {
            
@@ -184,6 +191,23 @@
        public bool UpdateClientAmount(int AddBalance, int payAmount, string clientId )
        {
            return OracleHelper.ExecuteSql("UPDATE GW_CLIENT SET BALANCE=(BALANCE + :BALANCE), TOP_UP_AMOUNT_TOTAL=(TOP_UP_AMOUNT_TOTAL + :TOP_UP_AMOUNT_TOTAL) WHERE CLIENT_ID=:CLIENT_ID", OracleHelper.Connection, new OracleParameter(":BALANCE", (object)AddBalance), new OracleParameter(":TOP_UP_AMOUNT_TOTAL", (object)payAmount), new OracleParameter(":CLIENT_ID", (object)clientId)) > 0;
        }
        public bool UpdateClientProduct(string clientId, string productId)
        {
            List<KeyValuePair<string, OracleParameter[]>> list = new List<KeyValuePair<string, OracleParameter[]>>();
            if (string.IsNullOrEmpty(productId) )
            {
                string key = "UPDATE GW_CLIENT_PRODUCT SET PRODUCT_ID=:PRODUCT_ID WHERE CLIENT_ID=:CLIENT_ID";
                OracleParameter[] oracleParameterArray = new OracleParameter[2]
                {
                  new OracleParameter(":PRODUCT_ID", (object) productId),
                  new OracleParameter(":CLIENT_ID", (object) clientId)
                };
                list.Add(new KeyValuePair<string, OracleParameter[]>(key, oracleParameterArray));
            }
            OracleHelper.ExecuteSqlTran(list, OracleHelper.Connection);
            return true;
        }
        /// <summary>
@@ -369,6 +393,39 @@
            }
            return true;
        }
        /**
         * 函数描述: 根据系统用户获取有权限客户
         * userId: 用户ID
         * userType: 用户类型:1-管理员;2-业务员--全员;3-业务主管;4-业务总监;5-客服人员;6-财务人员;99-其他
         * return: SQL字符串
         * */
        public string GetClientPermissions(int userId, int userType, string alias)
        {
            if (!string.IsNullOrEmpty(alias))
            {
                alias += ".";
            }
            string sqlStr = "";
            //业务员和其他
            if(userType==2 || userType == 99)
            {
                sqlStr  += " AND " + alias + "CLIENT_ID IN (SELECT CLIENT_ID FROM GW_CLIENT WHERE IS_ENABLE=1 AND (SALESMAN='" + userId + "' ) ) ";
            }
            //业务主管
            else if (userType == 3)
            {
                sqlStr += " AND " + alias + "CLIENT_ID IN (SELECT CLIENT_ID FROM GW_CLIENT WHERE IS_ENABLE=1 AND (SALESMAN='" + userId + "' or CUSTOMER_MANAGER='" + userId + "' ) ) ";
            }
            else
            {
                //sqlStr += " AND CLIENT_ID IN (SELECT CLIENT_ID FROM GW_CLIENT WHERE IS_ENABLE=1 ) ";
            }
            return sqlStr ;
        }
    }
}
web/Dao/GwOrderDao.cs
@@ -32,7 +32,7 @@
        //flag: 0-待审核订单(已提交、审核中);1-已完成订单(审核通过、审核不通过、取消)
        public List<GwOrder> LoadInfoList(string spId, string clientId, string clientName, int flag, DateTime startDate, DateTime endDate, int pageSize, int PageIndex, out int recordcount)
        public List<GwOrder> LoadInfoList(string spId, string clientId, string clientName, int flag, DateTime startDate, DateTime endDate, int pageSize, int PageIndex, string permissionsSQL, out int recordcount)
        {
            
            List<GwOrder> list = new List<GwOrder>();
@@ -85,6 +85,9 @@
                {
                    stringBuilder.Append(" and GWC.CLIENT_NAME like '%" + clientName + "%'");
                }
                //客户权限SQL脚本
                stringBuilder.Append(permissionsSQL);
                stringBuilder.Append(" ) T ");
                OracleParameter[] parameterArray = new OracleParameter[] { new OracleParameter(":START_TIME", startDate), new OracleParameter(":END_TIME", endDate) };
web/Dao/GwProductDao.cs
@@ -343,6 +343,14 @@
            return OracleHelper.ExecuteSql("UPDATE GW_PRODUCT SET IS_ENABLE=:IS_ENABLE where ID=:ID", OracleHelper.Connection, new OracleParameter(":IS_ENABLE", (object)isEnable), new OracleParameter(":ID", (object)id)) > 0;
        }
        //更新分配个性产品客户
        public bool UpdateClientIds(string clientIds, string id)
        {
            if (string.IsNullOrEmpty(id))
                return false;
            return OracleHelper.ExecuteSql("UPDATE GW_PRODUCT SET CLIENT_IDS=:CLIENT_IDS where ID=:ID", OracleHelper.Connection, new OracleParameter(":CLIENT_IDS", (object)clientIds), new OracleParameter(":ID", (object)id)) > 0;
        }
        //更新关联的产品路径PATH
        public bool UpdatePath(string id, string path)
        {
@@ -422,6 +430,7 @@
            o.CtExtParams = oracleReaderWrapper.GetString("CT_EXT_PARAMS", "");
            o.Price = oracleReaderWrapper.GetInt("PRICE", 0);
            o.GivingNum = oracleReaderWrapper.GetInt("GIVING_NUM", 0);
            o.ClientIds = oracleReaderWrapper.GetString("CLIENT_IDS", "");
            o.Remark = oracleReaderWrapper.GetString("REMARK", "");
            o.CreateTime = oracleReaderWrapper.GetDateTime("CREATE_TIME");
            o.Creator = oracleReaderWrapper.GetString("CREATOR", "");
web/Dao/GwSpDao.cs
@@ -245,7 +245,8 @@
      return list1;
    }
        public List<GwSp> LoadInfoList(string spId, string apId, string clientId, string clientName, int routerType, string opID, int chargeType, int pageIndex, int pageSize, string resendStatus, out int recordCount, string productId )
        public List<GwSp> LoadInfoList(string spId, string apId, string clientId, string clientName, int routerType, string opID, int chargeType, int pageIndex, int pageSize
            , string resendStatus, string productId, string permissionsSQL, out int recordCount )
        {
            List<GwSp> list1 = new List<GwSp>();
            recordCount = 0;
@@ -326,6 +327,10 @@
                list2.Add(new OracleParameter(":ProductId", (object)productId));
                stringBuilder.Append(" and Product_Id=:ProductId");
            }
            //客户权限SQL脚本
            stringBuilder.Append(permissionsSQL);
            stringBuilder.Append(" order by ID DESC");
            using (OracleDataReader reader = OracleHelper.ExecuteReader("select count(*) as count " + stringBuilder.ToString(), OracleHelper.Connection, list2.ToArray()))
            {
web/Dao/obj/Debug/Dao.csproj.AssemblyReference.cache
Binary files differ
web/Dao/obj/Debug/Dao.dll
Binary files differ
web/Dao/obj/Debug/Dao.pdb
Binary files differ
web/Lib/Dao.dll
Binary files differ
web/Lib/Dao.pdb
Binary files differ
web/Lib/Model.dll
Binary files differ
web/Lib/Model.pdb
Binary files differ
web/Model/Model/GwProduct.cs
@@ -49,6 +49,8 @@
        public int GivingNum { get; set; }
        public string ClientIds { get; set; }
        public string Remark { get; set; }
        public DateTime CreateTime { get; set; }
web/Model/obj/Debug/Model.csproj.AssemblyReference.cache
Binary files differ
web/Model/obj/Debug/Model.dll
Binary files differ
web/Model/obj/Debug/Model.pdb
Binary files differ
web/UMCLib/bin/Debug/UMCLib.dll
Binary files differ
web/UMCLib/bin/Debug/UMCLib.pdb
Binary files differ
web/UMCLib/obj/Debug/UMCLib.csproj.CoreCompileInputs.cache
@@ -1 +1 @@
c546f08e5171d2ea11491af4c442ff223c9bb58c
27f9b4fb5d36be9c155fb6557fe17e62c41ec4da
web/UMCLib/obj/Debug/UMCLib.csproj.FileListAbsolute.txt
@@ -6,3 +6,11 @@
D:\Company\SMGW_NewWeb\web\UMCLib\obj\Debug\UMCLib.csproj.CopyComplete
D:\Company\SMGW_NewWeb\web\UMCLib\obj\Debug\UMCLib.dll
D:\Company\SMGW_NewWeb\web\UMCLib\obj\Debug\UMCLib.pdb
C:\AYZH\work\Git_Rep\SMGW_NewWeb\web\UMCLib\bin\Debug\UMCLib.dll
C:\AYZH\work\Git_Rep\SMGW_NewWeb\web\UMCLib\bin\Debug\UMCLib.pdb
C:\AYZH\work\Git_Rep\SMGW_NewWeb\web\UMCLib\bin\Debug\Newtonsoft.Json.dll
C:\AYZH\work\Git_Rep\SMGW_NewWeb\web\UMCLib\obj\Debug\UMCLib.csproj.AssemblyReference.cache
C:\AYZH\work\Git_Rep\SMGW_NewWeb\web\UMCLib\obj\Debug\UMCLib.csproj.CoreCompileInputs.cache
C:\AYZH\work\Git_Rep\SMGW_NewWeb\web\UMCLib\obj\Debug\UMCLib.csproj.CopyComplete
C:\AYZH\work\Git_Rep\SMGW_NewWeb\web\UMCLib\obj\Debug\UMCLib.dll
C:\AYZH\work\Git_Rep\SMGW_NewWeb\web\UMCLib\obj\Debug\UMCLib.pdb
web/UMCLib/obj/Debug/UMCLib.dll
Binary files differ
web/UMCLib/obj/Debug/UMCLib.pdb
Binary files differ
web/web/Bin/App_Code.dll
Binary files differ
web/web/Bin/App_Code.pdb
Binary files differ
web/web/Bin/Dao.dll
Binary files differ
web/web/Bin/Dao.pdb
Binary files differ
web/web/Bin/Model.dll
Binary files differ
web/web/Bin/Model.pdb
Binary files differ
web/web/Bin/UMCLib.pdb
Binary files differ
web/web/ExportDocument.aspx.cs
@@ -307,7 +307,7 @@
            WebTool webTool = new WebTool();
            Dictionary<string, string> dictionary = new Dictionary<string, string>();
            dictionary["AP消息ID"] = "AP_MID";
            dictionary["代理商"] = "CLIENT_ID";
            dictionary["客户ID"] = "CLIENT_ID";
            dictionary["账号"] = "SP_ID";
            dictionary["接入点ID"] = "AP_ID";
            dictionary["通道名"] = "OP_NAME";
web/web/GwClient.ashx
@@ -1,5 +1,6 @@
<%@ WebHandler Language="C#" Class="GwClientHandler" %>
using System;
using System.Linq;
using System.Web;
using Dao;
using Model;
@@ -9,6 +10,7 @@
using System.Text;
using System.Text.RegularExpressions;
using System.IO;
using Newtonsoft.Json;
@@ -19,9 +21,17 @@
    private UserDao _SysUserDao = new UserDao();
    private List<SysUser> _SysUserList;
    private int _userId = -1;
    private int _userType = -1;
    private string _account = "";
    public override JsonPageResult ProcessRequestInternal(PageContext<Model.SysUser> context)
    {
        string action = context.GetString("action");
        _userId = context.SessionObject.UserID;
        _userType = context.SessionObject.UserType;
        _account = context.SessionObject.Account;
        switch (action)
        {
@@ -53,6 +63,9 @@
            case "updateBlack":
                return UpdateBlack(context);
            //批量分配客户的个性产品
            case "batchUpdateClientProduct":
                return BatchUpdateClientProduct(context);
            default:
                throw new Exception("Invalid Action=" + action);
@@ -82,10 +95,12 @@
        int pageSize = context.GetInt("pageSize", 20);
        string serverIp = ConfigurationManager.AppSettings["serverIp"];
        string clientPort = ConfigurationManager.AppSettings["clientPort"];
        string str = "";
        using (GwClientDao dao = new GwClientDao())
        {
            var list = dao.LoadInfoList(out recordCount, pageIndex, pageSize, ClientID, ClientName, Telephone, Agent, Company, Salesman, ProductId);
            string permissionsSQL = dao.GetClientPermissions(_userId, _userType, null);
            var list = dao.LoadInfoList(out recordCount, pageIndex, pageSize, ClientID, ClientName, Telephone, Agent, Company, Salesman, ProductId, permissionsSQL);
            if (list != null && list.Count > 0)
            {
@@ -99,7 +114,7 @@
                    //edit:yangzh by 20220511
                    //str += @"<tr ><td>" + item.ClientID + "</td><td>" + item.Company + "</td><td>" + item.ClientName + "</td><td>" + item.Telephone + "</td><td>" + item.Top_up_Amount_Total + "元</td><td>" + item.Agent + "</td><td>" + Certification_StatusResult + "</td>";
                    //str += @"<tr ><td>" + item.ClientID + "</td><td>" + item.Company + "</td><td>" + item.ClientName + "</td><td>" + item.Telephone + "</td><td>" + item.Balance/1000 + "元</td><td>" + item.Top_up_Amount_Total/1000 + "元</td><td>" + item.Agent + "</td><td>" + Certification_StatusResult + "</td>";
                    str += @"<tr ><td>" + item.ClientID + "</td><td>" + item.Company + "</td><td>" + item.ClientName + "</td><td>" + item.Telephone + "</td><td>" + item.Balance/1000 + "元</td><td>" + item.Top_up_Amount_Total/1000 + "元</td><td>" + SysUserName(string.IsNullOrEmpty(item.Salesman)? 0: int.Parse(item.Salesman) ) + "</td><td>" + Certification_StatusResult + "</td>";
                    str += @"<tr ><td  rowspan='1' ><input type='checkbox' name='checkbox' value='" + item.ClientID + "'/></td><td>" + item.ClientID + "</td><td>" + item.Company + "</td><td>" + item.ClientName + "</td><td>" + item.Telephone + "</td><td>" + item.Balance/1000 + "元</td><td>" + item.Top_up_Amount_Total/1000 + "元</td><td>" + SysUserName(string.IsNullOrEmpty(item.Salesman)? 0: int.Parse(item.Salesman) ) + "</td><td>" + Certification_StatusResult + "</td>";
                    str += @"<td>";
@@ -128,7 +143,7 @@
            }
            else
            {
                str += @"<tr><td colspan=""9"">暂无信息</td></tr>";
                str += @"<tr><td colspan=""10"">暂无信息</td></tr>";
            }
        }
@@ -334,13 +349,13 @@
        client.Company = company;
        //client.Password = password;
        client.Password = savePassword;
        client.ClientName = clientName;
        client.Address = address;
        client.Remark = remark;
        client.Telephone = telephone;
        client.Agent = agent;
        client.CustomerManager = customerManager;
        client.Salesman = salesman;
        client.SupportStaff = supportStaff;
@@ -534,6 +549,55 @@
        return new JsonPageResult(true, "创建账户成功!");
    }
    //分配客户的个性产品
    private JsonPageResult BatchUpdateClientProduct(PageContext<SysUser> context)
    {
        string productId = context.GetString("productId");
        string idArray = context.GetString("idArray");
        if (string.IsNullOrEmpty(productId))
        {
            throw new ArgumentException("个性产品不能为空,请选择!");
        }
        Model.GwProduct gwProduct = new GwProductDao().Get(productId);
        if (gwProduct == null)
        {
            throw new ArgumentException("指定的个性产品不存在,请重新选择!");
        }
        string clientIds = gwProduct.ClientIds;
        List<string> tmpList = new List<string>();
        if(!string.IsNullOrEmpty(clientIds))
        {   //字符串转数组,再数组合并
            tmpList.AddRange( clientIds.Split(',') );
        }
        //数组合并
        tmpList.AddRange( JsonConvert.DeserializeObject<string[]>(context.GetString("idArray")) );
        //数组去重
        string[] tmpArray = DelRepeatData(tmpList.ToArray() );
        clientIds = string.Join(",", tmpArray) ;
        if (!string.IsNullOrEmpty(clientIds))
        {
            new GwProductDao().UpdateClientIds(clientIds, productId);
        }
        return new JsonPageResult(true, (object)"批量分配客户个性产品成功!");
    }
    /// <summary>
    /// 移除数组中重复数据
    /// </summary>
    /// <param name="array">需要除重的数组</param>
    /// <returns>不重复数组</returns>
    public static string[] DelRepeatData(string[] array)
    {
        return array.GroupBy(p => p).Select(p => p.Key).ToArray();
    }
    //获取管理端账户列表
web/web/GwClient.aspx
@@ -72,8 +72,8 @@
                    $("#clientDialog #mmsStatusReport").val("");
                    $("#clientDialog #customerManager").val("");
                    $("#clientDialog #salesman").val("");
                    $("#clientDialog #supportStaff").val(r.Message.SupportStaff);
                    $("#clientDialog #financialStaff").val(r.Message.FinancialStaff);
                    $("#clientDialog #supportStaff").val("");
                    $("#clientDialog #financialStaff").val("");
                    $("#clientDialog #remark").val("");
                    $("#clientDialog input[name=permissionData]").iCheck("uncheck");
@@ -185,6 +185,60 @@
                    }
                });
            })
            //全选
            $("#checkAll").click(function () {
                $("input[name='checkbox']").prop("checked", $(this).is(":checked"));
            });
            //批量分配个性产品
            $(document).on("click", ".action-modal-setProduct", function () {
                var idArray = [];
                $("input[name='checkbox']:checkbox:checked").each(function () {
                    var id = $(this).val();
                    idArray.push(id);
                });
                if (idArray.length == 0) {
                    mytek.alert("请选择要分配个性产品的客户!", false);
                    return;
                }
                $("#selected-op-box").text(idArray.join(","));
                $("#setProductDialog").modal("show");
            });
            //批量分配客户个性产品--确认修改
            $(document).on("click", ".action-update-setProduct", function () {
                var idArray = [];
                $("input[name='checkbox']:checkbox:checked").each(function () {
                    var id = $(this).val();
                    idArray.push(id);
                });
                if (idArray.length == 0) {
                    mytek.alert("请选择要分配个性产品的客户!", false);
                    return;
                }
                var productId = $("#productId").val();
                $.ajax({
                    url: "GwClient.ashx",
                    method: "POST",
                    data: { idArray: $.toJSON(idArray), productId: productId, action: "batchUpdateClientProduct" },
                    success: function (result) {
                        mytek.alert(result.Message, result.OK, function () {
                            $("#setProductDialog #productId").val("");
                            $("#setProductDialog").modal("hide");
                            loadPageList();
                        });
                    }
                });
            });
@@ -495,7 +549,8 @@
        <div class="form-group">
            <div class="input-group m-b">
                <input type="button" value="查询" class="btn btn-primary action-query" />&nbsp
            <input class="btn btn-success action-modal-create" value="创建客户" type="button" />
            <input class="btn btn-success action-modal-create" value="创建客户" type="button" />&nbsp
            <input class="btn btn-danger action-modal-setProduct" value="批量分配个性产品" type="button" />
            </div>
        </div>
@@ -505,6 +560,9 @@
        <table class="table table-striped table-bordered table-hover" id="gwclientTable">
            <thead>
                <tr class="header">
                    <th>
                        <input type='checkbox' name='checkAll' id='checkAll' />
                    </th>
                    <th>客户账号
                    </th>
                    <th>公司名称</th>
@@ -533,6 +591,36 @@
    <div id="pager">
    </div>
    <div class="modal inmodal fade" id="setProductDialog" tabindex="-1" role="dialog" aria-hidden="true">
        <div class="modal-dialog form-horizontal">
            <div class="modal-content animated ">
                <div class="modal-header">
                    <h3>
                        批量分配个性产品</h3>
                    </span><a class="close" data-dismiss="modal" aria-hidden="true">×</a> <span class="text-muted">
                        批量分配个性产品将会更新所有选中的账号的客户,<br />
                        确定分配不能取消,请谨慎操作!<br />
                </div>
                <div class="modal-body">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">
                            个性产品
                        </label>
                        <div class="col-sm-10">
                            <select name="productId" id="productId" class="form-control">
                                 <%=GetPersonalityProductOptions("")%>
                              </select>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button class="btn-default btn" data-dismiss="modal" aria-hidden="true">
                        取消</button>&nbsp;&nbsp;
                    <input class="btn btn-primary action-update-setProduct" value="确定修改" type="button" />
                </div>
            </div>
        </div>
</asp:Content>
web/web/GwClient.aspx.cs
@@ -36,6 +36,7 @@
        {
            GwProduct bean = new GwProduct();
            bean.Classes = 1;
            bean.IsDefault = -1;
            bean.IsEnable = -1;
            this.GwProductList = gwProductDao.getAllList(bean);
        }
@@ -160,7 +161,7 @@
    {
        StringBuilder stringBuilder = new StringBuilder();
        if (this.GwProductList.Count == 0)
            return "<option value='0'>无</option>";
            return "<option value=''>无</option>";
        stringBuilder.AppendFormat("<option value=\"{0}\" >{1}</option>", (object)"", (object)"无");
        foreach (GwProduct bean in this.GwProductList)
        {
@@ -184,4 +185,38 @@
    }
    //获取个性产品信息
    public string GetPersonalityProductOptions(string productId)
    {
        StringBuilder stringBuilder = new StringBuilder();
        if (this.GwProductList.Count == 0)
            return "<option value=''>无</option>";
        stringBuilder.AppendFormat("<option value=\"{0}\" >{1}</option>", (object)"", (object)"无");
        foreach (GwProduct bean in this.GwProductList)
        {
            //停用的产品分类不再显示
            if (bean.IsEnable == 0)
            {
                continue;
            }
            //过滤产品类别
            if (bean.Classes == 0)
            {
                continue;
            }
            //过滤推广方式
            if (bean.IsDefault == 1)
            {
                continue;
            }
            if (productId.Equals(bean.Id))
                stringBuilder.AppendFormat("<option value=\"{0}\" selected>{0}-{1}</option>", (object)bean.Id, (object)bean.Name);
            else
                stringBuilder.AppendFormat("<option value=\"{0}\">{0}-{1}</option>", (object)bean.Id, (object)bean.Name);
        }
        return stringBuilder.ToString();
    }
}
web/web/GwOrder.ashx
@@ -23,10 +23,18 @@
    private List<GwOpGroup> _GroupList;
    private List<GwProduct> _ProductList;   //产品及产品分类
    //private List<GwProduct> _ProductClassList;  //产品分类
    private int _userId = -1;
    private int _userType = -1;
    private string _account = "";
    public override JsonPageResult ProcessRequestInternal(PageContext<SysUser> context)
    {
        string @string = context.GetString("action");
        _userId = context.SessionObject.UserID;
        _userType = context.SessionObject.UserType;
        _account = context.SessionObject.Account;
        switch (@string)
        {
            case "delete":
@@ -67,8 +75,10 @@
        int recordCount = 0;
        int pageSize = context.GetInt("pageSize", 50);
        int pageIndex = context.GetInt("pageIndex", 1);
        string permissionsSQL = new GwClientDao().GetClientPermissions(_userId, _userType, "GWC");
        List<GwOrder> list = _Dao.LoadInfoList(spId, clientId, clientName, flag, startDate, endDate, pageSize, pageIndex, out recordCount);
        List<GwOrder> list = _Dao.LoadInfoList(spId, clientId, clientName, flag, startDate, endDate, pageSize, pageIndex, permissionsSQL, out recordCount);
        string str1 = "";
        if (list != null && list.Count > 0)
@@ -125,8 +135,10 @@
        int recordCount = 0;
        int pageSize = context.GetInt("pageSize", 50);
        int pageIndex = context.GetInt("pageIndex", 1);
        string permissionsSQL = new GwClientDao().GetClientPermissions(_userId, _userType, "GWC");
        List<GwOrder> list = _Dao.LoadInfoList(spId, clientId, clientName, flag, startDate, endDate, pageSize, pageIndex, out recordCount);
        List<GwOrder> list = _Dao.LoadInfoList(spId, clientId, clientName, flag, startDate, endDate, pageSize, pageIndex, permissionsSQL, out recordCount);
        string str1 = "";
        if (list != null && list.Count > 0)
@@ -201,9 +213,11 @@
        int recordCount = 0;
        int pageSize = context.GetInt("pageSize", 50);
        int pageIndex = context.GetInt("pageIndex", 1);
        string permissionsSQL = new GwClientDao().GetClientPermissions(_userId, _userType, "GWC");
        //List<GwOrder> list = _Dao.LoadInfoList(spId, clientId, clientName, flag, Convert.ToDateTime(startDate), Convert.ToDateTime(endDate).AddDays(1.0), pageSize, pageIndex, out recordCount);
        List<GwOrder> list = _Dao.LoadInfoList(spId, clientId, clientName, flag, startDate, endDate.AddDays(1.0), pageSize, pageIndex, out recordCount);
        List<GwOrder> list = _Dao.LoadInfoList(spId, clientId, clientName, flag, startDate, endDate.AddDays(1.0), pageSize, pageIndex, permissionsSQL, out recordCount);
        string str1 = "";
        if (list != null && list.Count > 0)
web/web/GwOrderAudit.aspx
@@ -199,13 +199,13 @@
        <div class="m-b">
            <div class="form-group">
                <div class="input-group m-b">
                    <span class="input-group-addon">代理商客户账户</span>
                    <span class="input-group-addon">客户账户</span>
                    <input type="text" name="ClientId" id="ClientId" class="form-control col-md-2" />
                </div>
            </div>
            <div class="form-group">
                <div class="input-group m-b">
                    <span class="input-group-addon">代理商客户名称</span>
                    <span class="input-group-addon">客户名称</span>
                    <input type="text" name="ClientName" id="ClientName" class="form-control col-md-2" />
                </div>
            </div>
web/web/GwOrderComplete.aspx
@@ -93,13 +93,13 @@
        <div class="m-b">
            <div class="form-group">
                <div class="input-group m-b">
                    <span class="input-group-addon">代理商客户账户</span>
                    <span class="input-group-addon">客户账户</span>
                    <input type="text" name="ClientId" id="ClientId" class="form-control col-md-2" />
                </div>
            </div>
            <div class="form-group">
                <div class="input-group m-b">
                    <span class="input-group-addon">代理商客户名称</span>
                    <span class="input-group-addon">客户名称</span>
                    <input type="text" name="ClientName" id="ClientName" class="form-control col-md-2" />
                </div>
            </div>
web/web/GwSm.aspx
@@ -96,7 +96,7 @@
        </div>
        <div class="form-group">
            <div class="input-group m-b">
                <span class="input-group-addon">代理商</span>
                <span class="input-group-addon">客户ID</span>
                <input type="text" class="form-control" name="ClientID" id="ClientID" />
            </div>
        </div>
@@ -185,7 +185,7 @@
                        AP/OP消息MsgID
                    </th>
                    <th>
                        代理商-短信账号
                        客户-短信账号
                    </th>
                    <th>
                        客户接入协议-发送通道
web/web/GwSmResend.aspx
@@ -96,7 +96,7 @@
        </div>
        <div class="form-group">
            <div class="input-group m-b">
                <span class="input-group-addon">代理商</span>
                <span class="input-group-addon">客户ID</span>
                <input type="text" class="form-control" name="ClientID" id="ClientID" />
            </div>
        </div>
@@ -185,7 +185,7 @@
                        AP/OP消息MsgID
                    </th>
                    <th>
                        代理商-短信账号
                        客户-短信账号
                    </th>
                    <th>
                        客户接入协议-发送通道
web/web/GwSp.ashx
@@ -21,6 +21,10 @@
    private List<GwStrategy> _StrategyList;
    private List<GwProduct> _ProductList;
    private int _userId = -1;
    private int _userType = -1;
    private string _account = "";
    private List<GwOp> OpList
    {
        get
@@ -121,6 +125,10 @@
    public override JsonPageResult ProcessRequestInternal(PageContext<SysUser> context)
    {
        string @string = context.GetString("action");
        _userId = context.SessionObject.UserID;
        _userType = context.SessionObject.UserType;
        _account = context.SessionObject.Account;
        switch (@string)
        {
            case "updateSpStatus":
@@ -314,8 +322,11 @@
            apId = string1;
        //if (string.IsNullOrEmpty(clientId) && !string.IsNullOrEmpty(string4))
        //    clientId = new GwClientDao().GetClientName(string4).ClientID;
        string permissionsSQL = new GwClientDao().GetClientPermissions(_userId, _userType, null);
        //加载账号列表信息
        List<GwSp> list = gwSpDao.LoadInfoList(string2, apId, clientId, string4, int1, string3, int2, int4, int3, int5.ToString(),out recordCount, productId);
        List<GwSp> list = gwSpDao.LoadInfoList(string2, apId, clientId, string4, int1, string3, int2, int4, int3, int5.ToString(), productId, permissionsSQL, out recordCount);
        string str1 = "";
        if (list != null && list.Count > 0)
        {
web/web/Setting.aspx
@@ -1,207 +1,210 @@
<%@ Page Language="C#" masterpagefile="~/Main.master" AutoEventWireup="true" CodeFile="Setting.aspx.cs" Inherits="SettingPage" %>
<asp:Content ID="Content3" ContentPlaceHolderID="title" runat="Server">
    告警参数设置
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <script>
        $(function () {
            var setting = <%=Newtonsoft.Json.JsonConvert.SerializeObject(this.Setting) %>
            var smtpProfile = $.evalJSON(setting.SmtpProfile);
            var wxProfile =  $.evalJSON(setting.WxProfile);
            var sms57Profile =  $.evalJSON(setting.SmsProfile);
            $("#SmtpServer").val(smtpProfile.SmtpServer);
            $("#SmtpPort").val(smtpProfile.SmtpPort);
            $("#SmtpUsername").val(smtpProfile.Username);
            $("#SmtpPassword").val(smtpProfile.Password);
            $("#SmtpSenderAddress").val(smtpProfile.SenderAddress);
            $("#SmtpSSL").iCheck(smtpProfile.SSL ? "check": "uncheck");
            $("#WxAppID").val(wxProfile.AppID);
            $("#WxAppSecret").val(wxProfile.AppSecret);
            $("#WxMsgTemplateID").val(wxProfile.MsgTemplateID);
            $("#SmsUserID").val( sms57Profile.UserID);
            $("#SmsAccount").val(sms57Profile.Account );
            $("#SmsPassword").val(sms57Profile.Password );
            $("#SmsMTURL").val(sms57Profile.MTURL);
            $("#SmsExtNo").val(sms57Profile.ExtNo);
            $("#CmSegments").val(setting.CmSegments);
            $("#CuSegments").val(setting.CuSegments);
            $("#CtSegments").val(setting.CtSegments);
            $("#GwName").val(setting.GwName);
            $("#BlackMoContent").val(setting.BlackMoContent);
            $(".action-save").on("click", function () {
                smtpProfile.SmtpServer = $("#SmtpServer").val();
                smtpProfile.SmtpPort = $("#SmtpPort").val();
                smtpProfile.Username = $("#SmtpUsername").val();
                smtpProfile.Password = $("#SmtpPassword").val();
                smtpProfile.SenderAddress = $("#SmtpSenderAddress").val();
                smtpProfile.SSL = $("#SmtpSSL").is(":checked") ? 1 : 0;
                wxProfile.AppID = $("#WxAppID").val();
                wxProfile.AppSecret = $("#WxAppSecret").val();
                wxProfile.MsgTemplateID = $("#WxMsgTemplateID").val();
                sms57Profile.UserID = $("#SmsUserID").val();
                sms57Profile.Account = $("#SmsAccount").val();
                sms57Profile.Password = $("#SmsPassword").val();
                sms57Profile.MTURL = $("#SmsMTURL").val();
                sms57Profile.ExtNo = $("#SmsExtNo").val();
                $.ajax({
                    url: "setting.ashx",
                    method: "POST",
                    data: { action: "save",
                        "smsProfile": $.toJSON(sms57Profile),
                        "smtpProfile": $.toJSON(smtpProfile),
                        "wxProfile": $.toJSON(wxProfile),
                        "cmSegments":$("#CmSegments").val(),
                        "cuSegments":$("#CuSegments").val(),
                        "ctSegments":$("#CtSegments").val(),
                        "gwName":$("#GwName").val(),
                        "blackMoContent":$("#BlackMoContent").val()
                    },
                    success: function (result) {
                        if (result.OK) {
                            mytek.alert(result.Message,"success");
                        } else {
                            mytek.alert(result.Message,"warning");
                        }
                    }
                });
            });
        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="content" runat="Server">
    <form name="DefaultForm" method="post" action="GwSpUpdate.aspx" id="DefaultForm"
    class="form-horizontal">
    <div class="col-sm-12">
        <div class="ibox float-e-margins">
            <div class="ibox-title">
                基础设置
            </div>
            <div class="ibox-content">
                <div class="form-group">
                    <label class="control-label">
                        网关显示名称
                    </label>
                    <div>
                        <input type="text" name="GwName" id="GwName" value="" class="form-control" />
                    </div>
                </div>
                <div class="form-group hide">
                    <label class="control-label">
                        版权信息
                    </label>
                    <div>
                        <input type="text" name="CopyRights" id="CopyRights" value="" class="form-control" />
                    </div>
                </div>
                <div class="form-group hide">
                    <label class="control-label">
                        欢迎信息
                    </label>
                    <div>
                        <input type="text" name="WelcomeMessage" id="WelcomeMessage" value="" class="form-control" />
                    </div>
                </div>
                 <div class="form-group">
                    <label class="control-label">
                        手机上行自动加黑(多个上行内容之间用英文分号" ; "分割,内容中可以使用通配符" * ",每个 * 号代表0-10个字符)
                    </label>
                    <div>
                        <input type="text" value="" maxlength="1000" name="BlackMoContent" id="BlackMoContent" class="form-control" onkeyup="value=value.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5\*\;\ ]/g,'')"
                            onpaste="value=value.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5\*\;\ ]/g,'')" oncontextmenu = "value=value.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5\*\;\ ]/g,'')" />
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="col-sm-6 ">
        <div class="ibox float-e-margins">
            <div class="ibox-title">
                短信告警设置
            </div>
            <div class="ibox-content">
                <div class="form-group">
                    <label class="control-label">
                        USERID(接本SMGW网关平台,该值为0)</label>
                    <input type="text" value="" name="SmsUserID" id="SmsUserID" class="form-control" />
                </div>
                <div class="form-group">
                    <label class="control-label">
                        账号</label>
                    <input type="text" value="" name="SmsAccount" id="SmsAccount" class="form-control" />
                </div>
                <div class="form-group">
                    <label class="control-label">
                        密码</label>
                    <input type="password" value="" name="SmsPassword" id="SmsPassword" class="form-control" />
                </div>
                <div class="form-group">
                    <label class="control-label">
                        下发号码(或扩展码)</label>
                    <input type="text" value="" name="SmsExtNo" id="SmsExtNo" class="form-control" />
                </div>
                <div class="form-group">
                    <label class="control-label">
                        短信提交地址</label>
                    <input type="text" value="" name="SmsMTURL" id="SmsMTURL" class="form-control" />
                </div>
            </div>
        </div>
    </div>
    <div class="col-sm-6 ">
        <div class="ibox  float-e-margins">
            <div class="ibox-title">
                邮件告警设置
            </div>
            <div class="ibox-content">
                <div class="form-group ">
                    <label class="control-label">
                        SMTP服务器</label>
                    <input type="text" value="" name="SmtpServer" id="SmtpServer" class="form-control" />
                </div>
                <div class="form-group">
                    <label class="control-label">
                        SMTP端口</label>
                    <input type="text" value="" name="SmtpPort" id="SmtpPort" class="form-control" />
                </div>
                <div class="form-group">
                    <label class="control-label">
                        发送方邮件地址</label><input type="text" value="" name="SmtpSenderAddress" id="SmtpSenderAddress"
                            class="form-control" />
                </div>
                <div class="form-group">
                    <label class="control-label">
                        登录账号</label><input type="text" value="" name="SmtpUsername" id="SmtpUsername" class="form-control" />
                </div>
                <div class="form-group ">
                    <label class="control-label">
                        登录密码</label>
                    <input type="password" value="" name="SmtpPassword" id="SmtpPassword" class="form-control" />
                </div>
                <div class="form-group ">
                    <label class="control-label">
                        是否支持SSL</label>
                    <input type="checkbox" value="" name="SmtpSSL" id="SmtpSSL" class="form-control icheck-me" />
                </div>
            </div>
        </div>
    </div>
    <div class="ibox">
        <div class="ibox-content">
            <input class="action-save btn btn-primary pull-right" value="保存" type="button" />
        </div>
    </div>
    </form>
</asp:Content>
<%@ Page Language="C#" masterpagefile="~/Main.master" AutoEventWireup="true" CodeFile="Setting.aspx.cs" Inherits="SettingPage" %>
<asp:Content ID="Content3" ContentPlaceHolderID="title" runat="Server">
    告警参数设置
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <script>
        $(function () {
            var setting = <%=Newtonsoft.Json.JsonConvert.SerializeObject(this.Setting) %>
            var smtpProfile = $.evalJSON(setting.SmtpProfile);
            var wxProfile =  $.evalJSON(setting.WxProfile);
            var sms57Profile =  $.evalJSON(setting.SmsProfile);
            $("#SmtpServer").val(smtpProfile.SmtpServer);
            $("#SmtpPort").val(smtpProfile.SmtpPort);
            $("#SmtpUsername").val(smtpProfile.Username);
            $("#SmtpPassword").val(smtpProfile.Password);
            $("#SmtpSenderAddress").val(smtpProfile.SenderAddress);
            $("#SmtpSSL").iCheck(smtpProfile.SSL ? "check": "uncheck");
            $("#WxAppID").val(wxProfile.AppID);
            $("#WxAppSecret").val(wxProfile.AppSecret);
            $("#WxMsgTemplateID").val(wxProfile.MsgTemplateID);
            $("#SmsUserID").val( sms57Profile.UserID);
            $("#SmsAccount").val(sms57Profile.Account );
            $("#SmsPassword").val(sms57Profile.Password );
            $("#SmsMTURL").val(sms57Profile.MTURL);
            $("#SmsExtNo").val(sms57Profile.ExtNo);
            $("#CmSegments").val(setting.CmSegments);
            $("#CuSegments").val(setting.CuSegments);
            $("#CtSegments").val(setting.CtSegments);
            $("#GwName").val(setting.GwName);
            $("#BlackMoContent").val(setting.BlackMoContent);
            $(".action-save").on("click", function () {
                smtpProfile.SmtpServer = $("#SmtpServer").val();
                smtpProfile.SmtpPort = $("#SmtpPort").val();
                smtpProfile.Username = $("#SmtpUsername").val();
                smtpProfile.Password = $("#SmtpPassword").val();
                smtpProfile.SenderAddress = $("#SmtpSenderAddress").val();
                smtpProfile.SSL = $("#SmtpSSL").is(":checked") ? 1 : 0;
                wxProfile.AppID = $("#WxAppID").val();
                wxProfile.AppSecret = $("#WxAppSecret").val();
                wxProfile.MsgTemplateID = $("#WxMsgTemplateID").val();
                sms57Profile.UserID = $("#SmsUserID").val();
                sms57Profile.Account = $("#SmsAccount").val();
                sms57Profile.Password = $("#SmsPassword").val();
                sms57Profile.MTURL = $("#SmsMTURL").val();
                sms57Profile.ExtNo = $("#SmsExtNo").val();
                $.ajax({
                    url: "setting.ashx",
                    method: "POST",
                    data: { action: "save",
                        "smsProfile": $.toJSON(sms57Profile),
                        "smtpProfile": $.toJSON(smtpProfile),
                        "wxProfile": $.toJSON(wxProfile),
                        "cmSegments":$("#CmSegments").val(),
                        "cuSegments":$("#CuSegments").val(),
                        "ctSegments":$("#CtSegments").val(),
                        "gwName":$("#GwName").val(),
                        "blackMoContent":$("#BlackMoContent").val()
                    },
                    success: function (result) {
                        if (result.OK) {
                            mytek.alert(result.Message,"success");
                        } else {
                            mytek.alert(result.Message,"warning");
                        }
                    }
                });
            });
        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="content" runat="Server">
    <form name="DefaultForm" method="post" action="GwSpUpdate.aspx" id="DefaultForm"
    class="form-horizontal">
    <div class="col-sm-12">
        <div class="ibox float-e-margins">
            <div class="ibox-title">
                基础设置
            </div>
            <div class="ibox-content">
                <div class="form-group">
                    <label class="control-label">
                        网关显示名称
                    </label>
                    <div>
                        <input type="text" name="GwName" id="GwName" value="" class="form-control" />
                    </div>
                </div>
                <div class="form-group hide">
                    <label class="control-label">
                        版权信息
                    </label>
                    <div>
                        <input type="text" name="CopyRights" id="CopyRights" value="" class="form-control" />
                    </div>
                </div>
                <div class="form-group hide">
                    <label class="control-label">
                        欢迎信息
                    </label>
                    <div>
                        <input type="text" name="WelcomeMessage" id="WelcomeMessage" value="" class="form-control" />
                    </div>
                </div>
                 <div class="form-group">
                    <label class="control-label">
                        手机上行自动加黑(多个上行内容之间用英文分号" ; "分割,内容中可以使用通配符" * ",每个 * 号代表0-10个字符)
                    </label>
                    <div>
                        <input type="text" value="" maxlength="1000" name="BlackMoContent" id="BlackMoContent" class="form-control" onkeyup="value=value.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5\*\;\ ]/g,'')"
                            onpaste="value=value.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5\*\;\ ]/g,'')" oncontextmenu = "value=value.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5\*\;\ ]/g,'')" />
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="col-sm-6 ">
        <div class="ibox float-e-margins">
            <div class="ibox-title">
                短信告警设置
            </div>
            <div class="ibox-content">
                <div class="form-group">
                    <label class="control-label">
                        USERID(接本SMGW网关平台,该值为0)</label>
                    <input type="text" value="" name="SmsUserID" id="SmsUserID" class="form-control" />
                </div>
                <div class="form-group">
                    <label class="control-label">
                        账号</label>
                    <input type="text" value="" name="SmsAccount" id="SmsAccount" class="form-control" />
                </div>
                <div class="form-group">
                    <label class="control-label">
                        密码</label>
                    <input type="password" value="" name="SmsPassword" id="SmsPassword" class="form-control" />
                </div>
                <div class="form-group">
                    <label class="control-label">
                        下发号码(或扩展码)</label>
                    <input type="text" value="" name="SmsExtNo" id="SmsExtNo" class="form-control" />
                </div>
                <div class="form-group">
                    <label class="control-label">
                        短信提交地址</label>
                    <input type="text" value="" name="SmsMTURL" id="SmsMTURL" class="form-control" />
                </div>
            </div>
        </div>
    </div>
    <div class="col-sm-6 ">
        <div class="ibox  float-e-margins">
            <div class="ibox-title">
                邮件告警设置
            </div>
            <div class="ibox-content">
                <div class="form-group ">
                    <label class="control-label">
                        SMTP服务器</label>
                    <input type="text" value="" name="SmtpServer" id="SmtpServer" class="form-control" />
                </div>
                <div class="form-group">
                    <label class="control-label">
                        SMTP端口</label>
                    <input type="text" value="" name="SmtpPort" id="SmtpPort" class="form-control" />
                </div>
                <div class="form-group">
                    <label class="control-label">
                        发送方邮件地址</label><input type="text" value="" name="SmtpSenderAddress" id="SmtpSenderAddress"
                            class="form-control" />
                </div>
                <div class="form-group">
                    <label class="control-label">
                        登录账号</label><input type="text" value="" name="SmtpUsername" id="SmtpUsername" class="form-control" />
                </div>
                <div class="form-group ">
                    <label class="control-label">
                        登录密码</label>
                    <input type="password" value="" name="SmtpPassword" id="SmtpPassword" class="form-control" />
                </div>
                <div class="form-group ">
                    <label class="control-label">
                        是否支持SSL</label>
                    <input type="checkbox" value="" name="SmtpSSL" id="SmtpSSL" class="form-control icheck-me" />
                </div>
            </div>
        </div>
    </div>
    <div class="ibox">
        <div class="ibox-content">
            <input class="action-save btn btn-primary pull-right" value="保存" type="button" />
        </div>
    </div>
    </form>
</asp:Content>
web/web/gwspupdate.aspx.cs
@@ -80,6 +80,7 @@
        {
            GwProduct bean = new GwProduct();
            bean.Classes = 1;
            bean.IsDefault = -1;
            bean.IsEnable = -1;
            this.GwProductList = gwProductDao.getAllList(bean);
        }