From dbda463cdacc6c6101acdf9d58e22450a281b9b0 Mon Sep 17 00:00:00 2001
From: yzh <snbbt@21cn.com>
Date: 星期二, 07 六月 2022 23:11:04 +0800
Subject: [PATCH] 客户信息管理 停用客户信息管理

---
 web/web/Bin/Dao.dll             |    0 
 web/web/GwOrderComplete.aspx    |    6 
 web/web/Main.master             |    4 
 web/web/GwOrderCreate.aspx.cs   |  108 +++
 web/Lib/Model.dll               |    0 
 web/web/GwOrder.ashx            |  201 ++++--
 web/web/GwProduct.aspx          |    6 
 web/web/GwSpPrePattern.aspx     |   81 +-
 web/web/GwOrderList.aspx        |   38 
 web/web/GwOrderAudit.aspx.cs    |   15 
 web/web/Bin/Dao.pdb             |    0 
 web/Dao/GwOrderDao.cs           |    5 
 web/Lib/Model.pdb               |    0 
 web/web/GwClient.aspx.cs        |   51 +
 web/Model/Model/GwClient.cs     |   29 +
 web/Dao/GwClientDao.cs          |  158 +++++
 web/Lib/Dao.dll                 |    0 
 web/web/Index.aspx              |    3 
 web/web/GwClient.ashx           |  237 +++++++-
 web/web/GwOrderComplete.aspx.cs |   15 
 web/web/Bin/Model.pdb           |    0 
 web/web/GwAuditCache.aspx       |   68 +-
 web/web/GwOrderList.aspx.cs     |   28 
 web/Model/Model/GwOrder.cs      |    9 
 web/web/GwClient.aspx           |  458 +++++++++++++++-
 web/web/GwOrderCreate.aspx      |   54 +
 web/web/GwOrderAudit.aspx       |   24 
 web/web/Bin/Model.dll           |    0 
 web/Lib/Dao.pdb                 |    0 
 29 files changed, 1,287 insertions(+), 311 deletions(-)

diff --git a/web/Dao/GwClientDao.cs b/web/Dao/GwClientDao.cs
index 63c97d9..4a7c3c8 100644
--- a/web/Dao/GwClientDao.cs
+++ b/web/Dao/GwClientDao.cs
@@ -21,7 +21,7 @@
         /// <param name="pageSizestring"></param>
         /// <param name="clientID">瀹㈡埛璐﹀彿鍚嶇О</param>
         /// <param name="clientName">鑱旂郴浜�</param>
-        /// <param name="telphone">鑱旂郴鐢佃瘽</param>
+        /// <param name="telephone">鑱旂郴鐢佃瘽</param>
         /// <param name="agent">涓氬姟鍛�</param>
         /// <param name="company">鍏徃鍚嶇О</param>
         /// <param name="salesman">褰掑睘涓氬姟鍛�</param>
@@ -29,7 +29,7 @@
         /// <param name="productId">浜у搧ID</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 supportStaff, string productId, string permissionsSQL )
+        public List<GwClient> LoadInfoList(out int recordCount, int pageIndex, int pageSizestring, string clientID, string clientName, string telephone, string agent, string company, string salesman, string supportStaff, string productId, int isEnable, string permissionsSQL )
         {
 
             List<GwClient> list = new List<GwClient>();
@@ -37,58 +37,75 @@
             try
             {
                 StringBuilder stringBuilder = new StringBuilder();
-                stringBuilder.Append("from GW_CLIENT where 1=1");
-                OracleParameter[] oracleParameterArray = new OracleParameter[7];
+                stringBuilder.Append(" FROM ( ");
+                stringBuilder.Append("SELECT gwc.*, t.PRODUCT_IDS  FROM GW_CLIENT gwc ");
+                stringBuilder.Append(" LEFT JOIN ( ");
+                stringBuilder.Append(" select gc.client_id, wm_concat( gp.name) PRODUCT_IDS from GW_CLIENT gc ");
+                stringBuilder.Append(" LEFT JOIN gw_product gp on INSTR (CLIENT_IDS, gc.client_id) > 0 ");
+                stringBuilder.Append(" GROUP BY gc.client_id ");
+                stringBuilder.Append(" ) t on t.client_id = gwc.client_id ");
+                //stringBuilder.Append("from GW_CLIENT where 1=1");
+                stringBuilder.Append(" WHERE 1=1");
+                OracleParameter[] oracleParameterArray = new OracleParameter[8];
                 if (clientID != null && clientID != "")
                 {
                     oracleParameterArray[0] = new OracleParameter(":ClientID", (OracleDbType)126);
                     ((DbParameter)oracleParameterArray[0]).Value = (object)('%' + clientID + '%');
-                    stringBuilder.Append(" and CLIENT_ID like :ClientID");
+                    stringBuilder.Append(" and gwc.CLIENT_ID like :ClientID");
                 }
                 if (clientName != null && clientName != "")
                 {
                     oracleParameterArray[1] = new OracleParameter(":ClientName", (OracleDbType)126);
                     ((DbParameter)oracleParameterArray[1]).Value = (object)('%' + clientName + '%');
-                    stringBuilder.Append(" and CLIENT_NAME like :ClientName");
+                    stringBuilder.Append(" and gwc.CLIENT_NAME like :ClientName");
                 }
-                if (telphone != null && telphone != "")
+                if (telephone != null && telephone != "")
                 {
-                    oracleParameterArray[2] = new OracleParameter(":Telphone", (OracleDbType)126);
-                    ((DbParameter)oracleParameterArray[2]).Value = (object)('%' + telphone + '%');
-                    stringBuilder.Append(" and Telphone like :Telphone");
+                    oracleParameterArray[2] = new OracleParameter(":Telephone", (OracleDbType)126);
+                    ((DbParameter)oracleParameterArray[2]).Value = (object)('%' + telephone + '%');
+                    stringBuilder.Append(" and gwc.TELEPHONE like :Telephone");
                 }
                 if (company != null && company != "")
                 {
                     oracleParameterArray[3] = new OracleParameter(":Company", (OracleDbType)126);
                     ((DbParameter)oracleParameterArray[3]).Value = (object)('%' + company + '%');
-                    stringBuilder.Append(" and Company like :Company");
+                    stringBuilder.Append(" and gwc.Company like :Company");
                 }
                 if (salesman != null && salesman != "")
                 {
                     oracleParameterArray[4] = new OracleParameter(":Salesman", (OracleDbType)126);
                     ((DbParameter)oracleParameterArray[4]).Value = (object)( salesman );
-                    stringBuilder.Append(" and Salesman = :Salesman");
+                    stringBuilder.Append(" and gwc.Salesman = :Salesman");
                 }
                 if (agent != null && agent != "")
                 {
                     oracleParameterArray[5] = new OracleParameter(":Agent", (OracleDbType)126);
                     ((DbParameter)oracleParameterArray[5]).Value = (object)("%" + agent + "%");
-                    stringBuilder.Append(" and Agent like :Agent");
+                    stringBuilder.Append(" and gwc.Agent like :Agent");
                 }
+                
                 if (supportStaff != null && supportStaff != "")
                 {
                     oracleParameterArray[6] = new OracleParameter(":SupportStaff", (OracleDbType)126);
                     ((DbParameter)oracleParameterArray[6]).Value = (object)(supportStaff);
-                    stringBuilder.Append(" and SUPPORT_STAFF = :SupportStaff");
+                    stringBuilder.Append(" and gwc.SUPPORT_STAFF = :SupportStaff");
+                }
+                if (isEnable != -1)
+                {
+                    oracleParameterArray[7] = new OracleParameter(":IS_ENABLE", (OracleDbType)112);
+                    ((DbParameter)oracleParameterArray[7]).Value = (object)(isEnable);
+                    stringBuilder.Append(" and gwc.IS_ENABLE = :IS_ENABLE");
                 }
 
                 if (productId != null && productId != "")
                 {
-                    stringBuilder.Append(" and CLIENT_ID IN ( SELECT distinct CLIENT_ID  FROM GW_SP WHERE PRODUCT_ID = '" + productId + "' )");
+                    stringBuilder.Append(" and gwc.CLIENT_ID IN ( SELECT distinct CLIENT_ID  FROM GW_SP WHERE PRODUCT_ID = '" + productId + "' )");
                 }
 
                 //瀹㈡埛鏉冮檺SQL鑴氭湰
                 stringBuilder.Append(permissionsSQL);
+
+                stringBuilder.Append(" ) T ");
 
                 stringBuilder.Append(" order by CREATE_TIME DESC,CLIENT_ID DESC");
                 using (OracleDataReader reader = OracleHelper.ExecuteReader("select count(*) as count " + stringBuilder.ToString(), OracleHelper.Connection, oracleParameterArray))
@@ -224,6 +241,24 @@
             return true;
         }
 
+        //鍚敤鎴栧仠鐢�
+        public bool UpdateStatus(string clientId, string isEnable)
+        {
+            List<KeyValuePair<string, OracleParameter[]>> list = new List<KeyValuePair<string, OracleParameter[]>>();
+            if (!string.IsNullOrEmpty(isEnable))
+            {
+                string key = "UPDATE GW_CLIENT SET IS_ENABLE=:IS_ENABLE WHERE CLIENT_ID=:CLIENT_ID";
+                OracleParameter[] oracleParameterArray = new OracleParameter[2]
+                {
+                  new OracleParameter(":IS_ENABLE", (object) isEnable),
+                  new OracleParameter(":CLIENT_ID", (object) clientId)
+                };
+                list.Add(new KeyValuePair<string, OracleParameter[]>(key, oracleParameterArray));
+            }
+            OracleHelper.ExecuteSqlTran(list, OracleHelper.Connection);
+            return true;
+        }
+
         /// <summary>
         /// 鏇存柊璐﹀彿鐨勪俊鎭�
         /// </summary>
@@ -231,12 +266,12 @@
         /// <returns></returns>
         public bool Update(GwClient item)
         {
-            return OracleHelper.ExecuteSql("UPDATE GW_CLIENT SET CLIENT_ID=:CLIENT_ID,CLIENT_NAME=:CLIENTNAME,TELEPHONE=:TELEPHONE,ADDRESS=:ADDRESS,COMPANY=:COMPANY,REMARK=:REMARK,PASSWORD=:PASSWORD,AGENT=:AGENT,SALESMAN=:SALESMAN,CUSTOMER_MANAGER=:CUSTOMER_MANAGER,SUPPORT_STAFF=:SUPPORT_STAFF,FINANCIAL_STAFF=:FINANCIAL_STAFF,CHARGE_TYPE=:CHARGE_TYPE,SMS_STATUS_REPORT=:SMS_STATUS_REPORT,MMS_STATUS_REPORT=:MMS_STATUS_REPORT,PERMISSION_DATA=:PERMISSION_DATA,CREATE_TIME=SYSDATE WHERE CLIENT_ID=:Id", OracleHelper.Connection, new OracleParameter(":Id",(object)item.ClientID), new OracleParameter(":CLIENT_ID", (object)item.ClientID), new OracleParameter(":CLIENTNAME", (object)item.ClientName), new OracleParameter(":TELEPHONE", (object)item.Telephone), new OracleParameter(":ADDRESS", (object)item.Address), new OracleParameter(":COMPANY", (object)item.Company), new OracleParameter(":REMARK", (object)item.Remark), new OracleParameter(":PASSWORD", (object)item.Password), new OracleParameter(":AGENT", (object)item.Agent), new OracleParameter(":SALESMAN", (object)item.Salesman), new OracleParameter(":CUSTOMER_MANAGER", (object)item.CustomerManager), new OracleParameter(":SUPPORT_STAFF", (object)item.SupportStaff), new OracleParameter(":FINANCIAL_STAFF", (object)item.FinancialStaff), new OracleParameter(":CHARGE_TYPE", (object)item.ChargeType), new OracleParameter(":SMS_STATUS_REPORT", (object)item.SmsStatusReport), new OracleParameter(":MMS_STATUS_REPORT", (object)item.MmsStatusReport), new OracleParameter(":PERMISSION_DATA", (object)item.PermissionData)) > 0;
+            return OracleHelper.ExecuteSql("UPDATE GW_CLIENT SET CLIENT_ID=:CLIENT_ID,CLIENT_NAME=:CLIENTNAME,TELEPHONE=:TELEPHONE,ADDRESS=:ADDRESS,COMPANY=:COMPANY,REMARK=:REMARK,AGENT=:AGENT,SALESMAN=:SALESMAN,CUSTOMER_MANAGER=:CUSTOMER_MANAGER,SUPPORT_STAFF=:SUPPORT_STAFF,FINANCIAL_STAFF=:FINANCIAL_STAFF,CHARGE_TYPE=:CHARGE_TYPE,SMS_STATUS_REPORT=:SMS_STATUS_REPORT,MMS_STATUS_REPORT=:MMS_STATUS_REPORT,PERMISSION_DATA=:PERMISSION_DATA, IS_ENABLE_WHITE=:IS_ENABLE_WHITE, IS_ENABLE_BLACK=:IS_ENABLE_BLACK, IS_REMOTE_LOGIN_NOTICE=:IS_REMOTE_LOGIN_NOTICE, IS_MOBILE_CAPTCHA=:IS_MOBILE_CAPTCHA, IS_HIDE_MOBILE=:IS_HIDE_MOBILE, IS_DISPLAY_STATUS=:IS_DISPLAY_STATUS, IS_LOGIN_IP_RESTRICT=:IS_LOGIN_IP_RESTRICT, IS_LOGIN_IP_ALLOW_GATHER=:IS_LOGIN_IP_ALLOW_GATHER, IS_LOGIN_CITY_RESTRICT=:IS_LOGIN_CITY_RESTRICT, IS_LOGIN_CITY_ALLOW_GATHER=:IS_LOGIN_CITY_ALLOW_GATHER,CREATE_TIME=SYSDATE WHERE CLIENT_ID=:Id", OracleHelper.Connection, new OracleParameter(":Id",(object)item.ClientID), new OracleParameter(":CLIENT_ID", (object)item.ClientID), new OracleParameter(":CLIENTNAME", (object)item.ClientName), new OracleParameter(":TELEPHONE", (object)item.Telephone), new OracleParameter(":ADDRESS", (object)item.Address), new OracleParameter(":COMPANY", (object)item.Company), new OracleParameter(":REMARK", (object)item.Remark), new OracleParameter(":AGENT", (object)item.Agent), new OracleParameter(":SALESMAN", (object)item.Salesman), new OracleParameter(":CUSTOMER_MANAGER", (object)item.CustomerManager), new OracleParameter(":SUPPORT_STAFF", (object)item.SupportStaff), new OracleParameter(":FINANCIAL_STAFF", (object)item.FinancialStaff), new OracleParameter(":CHARGE_TYPE", (object)item.ChargeType), new OracleParameter(":SMS_STATUS_REPORT", (object)item.SmsStatusReport), new OracleParameter(":MMS_STATUS_REPORT", (object)item.MmsStatusReport), new OracleParameter(":PERMISSION_DATA", (object)item.PermissionData), new OracleParameter(":IS_ENABLE_WHITE", (object)item.IsEnableWhite), new OracleParameter(":IS_ENABLE_BLACK", (object)item.IsEnableBlack), new OracleParameter(":IS_REMOTE_LOGIN_NOTICE", (object)item.IsRemoteLoginNotice), new OracleParameter(":IS_MOBILE_CAPTCHA", (object)item.IsMobileCaptcha), new OracleParameter(":IS_HIDE_MOBILE", (object)item.IsHideMobile), new OracleParameter(":IS_DISPLAY_STATUS", (object)item.IsDisplayStatus), new OracleParameter(":IS_LOGIN_IP_RESTRICT", (object)item.IsLoginIpRestrict), new OracleParameter(":IS_LOGIN_IP_ALLOW_GATHER", (object)item.IsLoginIpAllowGather), new OracleParameter(":IS_LOGIN_CITY_RESTRICT", (object)item.IsLoginCityRestrict), new OracleParameter(":IS_LOGIN_CITY_ALLOW_GATHER", (object)item.IsLoginCityAllowGather) ) > 0;
         }
 
         public bool Add(GwClient item)
         {
-            return OracleHelper.ExecuteSql("INSERT INTO GW_CLIENT(CLIENT_ID,CLIENT_NAME,TELEPHONE,ADDRESS,AGENT,SALESMAN,CUSTOMER_MANAGER,SUPPORT_STAFF,FINANCIAL_STAFF,CHARGE_TYPE,SMS_STATUS_REPORT,MMS_STATUS_REPORT,COMPANY,REMARK,PASSWORD,PERMISSION_DATA,CREATE_TIME,PARENTID,Certification_Status) VALUES(:CLIENTID,:CLIENTNAME,:TELEPHONE,:ADDRESS,:AGENT,:SALESMAN,:CUSTOMER_MANAGER,:SUPPORT_STAFF,:FINANCIAL_STAFF,:CHARGE_TYPE,:SMS_STATUS_REPORT,:MMS_STATUS_REPORT,:COMPANY,:REMARK,:PASSWORD,:PERMISSION_DATA,SYSDATE,:PARENTID,:Certification_Status)", OracleHelper.Connection, new OracleParameter(":CLIENTID", (object)item.ClientID), new OracleParameter(":CLIENTNAME", (object)item.ClientName), new OracleParameter(":TELEPHONE", (object)item.Telephone), new OracleParameter(":ADDRESS", (object)item.Address), new OracleParameter(":AGENT", (object)item.Agent), new OracleParameter(":SALESMAN", (object)item.Salesman), new OracleParameter(":CUSTOMER_MANAGER", (object)item.CustomerManager), new OracleParameter(":SUPPORT_STAFF", (object)item.SupportStaff), new OracleParameter(":FINANCIAL_STAFF", (object)item.FinancialStaff), new OracleParameter(":CHARGE_TYPE", (object)item.ChargeType), new OracleParameter(":SMS_STATUS_REPORT", (object)item.SmsStatusReport), new OracleParameter(":MMS_STATUS_REPORT", (object)item.MmsStatusReport), new OracleParameter(":COMPANY", (object)item.Company), new OracleParameter(":REMARK", (object)item.Remark), new OracleParameter(":PASSWORD", (object)item.Password), new OracleParameter(":PERMISSION_DATA", (object)item.PermissionData), new OracleParameter(":PARENTID", (object)item.ParentId), new OracleParameter(":Certification_Status", (object)item.Certification_Status)) > 0;
+            return OracleHelper.ExecuteSql("INSERT INTO GW_CLIENT(CLIENT_ID,CLIENT_NAME,TELEPHONE,ADDRESS,AGENT,SALESMAN,CUSTOMER_MANAGER,SUPPORT_STAFF,FINANCIAL_STAFF,CHARGE_TYPE,SMS_STATUS_REPORT,MMS_STATUS_REPORT,COMPANY,REMARK,PASSWORD,PERMISSION_DATA, IS_ENABLE_WHITE, IS_ENABLE_BLACK, IS_REMOTE_LOGIN_NOTICE, IS_MOBILE_CAPTCHA, IS_HIDE_MOBILE, IS_DISPLAY_STATUS, IS_LOGIN_IP_RESTRICT, IS_LOGIN_IP_ALLOW_GATHER, IS_LOGIN_CITY_RESTRICT, IS_LOGIN_CITY_ALLOW_GATHER,CREATE_TIME,PARENTID,Certification_Status) VALUES(:CLIENTID,:CLIENTNAME,:TELEPHONE,:ADDRESS,:AGENT,:SALESMAN,:CUSTOMER_MANAGER,:SUPPORT_STAFF,:FINANCIAL_STAFF,:CHARGE_TYPE,:SMS_STATUS_REPORT,:MMS_STATUS_REPORT,:COMPANY,:REMARK,:PASSWORD,:PERMISSION_DATA, :IS_ENABLE_WHITE, :IS_ENABLE_BLACK, :IS_REMOTE_LOGIN_NOTICE, :IS_MOBILE_CAPTCHA, :IS_HIDE_MOBILE, :IS_DISPLAY_STATUS, :IS_LOGIN_IP_RESTRICT, :IS_LOGIN_IP_ALLOW_GATHER, :IS_LOGIN_CITY_RESTRICT, :IS_LOGIN_CITY_ALLOW_GATHER,SYSDATE,:PARENTID,:Certification_Status)", OracleHelper.Connection, new OracleParameter(":CLIENTID", (object)item.ClientID), new OracleParameter(":CLIENTNAME", (object)item.ClientName), new OracleParameter(":TELEPHONE", (object)item.Telephone), new OracleParameter(":ADDRESS", (object)item.Address), new OracleParameter(":AGENT", (object)item.Agent), new OracleParameter(":SALESMAN", (object)item.Salesman), new OracleParameter(":CUSTOMER_MANAGER", (object)item.CustomerManager), new OracleParameter(":SUPPORT_STAFF", (object)item.SupportStaff), new OracleParameter(":FINANCIAL_STAFF", (object)item.FinancialStaff), new OracleParameter(":CHARGE_TYPE", (object)item.ChargeType), new OracleParameter(":SMS_STATUS_REPORT", (object)item.SmsStatusReport), new OracleParameter(":MMS_STATUS_REPORT", (object)item.MmsStatusReport), new OracleParameter(":COMPANY", (object)item.Company), new OracleParameter(":REMARK", (object)item.Remark), new OracleParameter(":PASSWORD", (object)item.Password), new OracleParameter(":PERMISSION_DATA", (object)item.PermissionData), new OracleParameter(":PARENTID", (object)item.ParentId), new OracleParameter(":Certification_Status", (object)item.Certification_Status), new OracleParameter(":IS_ENABLE_WHITE", (object)item.IsEnableWhite), new OracleParameter(":IS_ENABLE_BLACK", (object)item.IsEnableBlack), new OracleParameter(":IS_REMOTE_LOGIN_NOTICE", (object)item.IsRemoteLoginNotice), new OracleParameter(":IS_MOBILE_CAPTCHA", (object)item.IsMobileCaptcha), new OracleParameter(":IS_HIDE_MOBILE", (object)item.IsHideMobile), new OracleParameter(":IS_DISPLAY_STATUS", (object)item.IsDisplayStatus), new OracleParameter(":IS_LOGIN_IP_RESTRICT", (object)item.IsLoginIpRestrict), new OracleParameter(":IS_LOGIN_IP_ALLOW_GATHER", (object)item.IsLoginIpAllowGather), new OracleParameter(":IS_LOGIN_CITY_RESTRICT", (object)item.IsLoginCityRestrict), new OracleParameter(":IS_LOGIN_CITY_ALLOW_GATHER", (object)item.IsLoginCityAllowGather) ) > 0;
         }
 
         public GwClient Get(string clientID)
@@ -337,6 +372,7 @@
             o.BalanceThreshold = oracleReaderWrapper.GetInt("BALANCE_THRESHOLD", 0);
             o.Balance = oracleReaderWrapper.GetInt("BALANCE", 0);
             o.PermissionData = oracleReaderWrapper.GetString("PERMISSION_DATA", "");
+            o.ProductIds = oracleReaderWrapper.GetString("PRODUCT_IDS", ""); ;    //宸插垎閰嶇殑涓�т骇鍝侀泦锛屽涓互鈥�,鈥濆垎闅�
             o.Id = oracleReaderWrapper.GetInt("ID", 0);
             o.Certification_Status = oracleReaderWrapper.GetInt("CERTIFICATION_STATUS", 0);
             o.Client_Classes = oracleReaderWrapper.GetInt("CLIENT_CLASSES",0);
@@ -351,6 +387,17 @@
             o.ChargeType = oracleReaderWrapper.GetInt("CHARGE_TYPE", 0);
             o.SmsStatusReport = oracleReaderWrapper.GetInt("SMS_STATUS_REPORT", 0);
             o.MmsStatusReport = oracleReaderWrapper.GetInt("MMS_STATUS_REPORT", 0);
+
+            o.IsEnableWhite = oracleReaderWrapper.GetInt("IS_ENABLE_WHITE", 0);
+            o.IsEnableBlack = oracleReaderWrapper.GetInt("IS_ENABLE_BLACK", 0);
+            o.IsRemoteLoginNotice = oracleReaderWrapper.GetInt("IS_REMOTE_LOGIN_NOTICE", 0);
+            o.IsMobileCaptcha = oracleReaderWrapper.GetInt("IS_MOBILE_CAPTCHA", 0);
+            o.IsHideMobile = oracleReaderWrapper.GetInt("IS_HIDE_MOBILE", 0);
+            o.IsDisplayStatus = oracleReaderWrapper.GetInt("IS_DISPLAY_STATUS", 0);
+            o.IsLoginIpRestrict = oracleReaderWrapper.GetInt("IS_LOGIN_IP_RESTRICT", 0);
+            o.IsLoginIpAllowGather = oracleReaderWrapper.GetString("IS_LOGIN_IP_ALLOW_GATHER", "");
+            o.IsLoginCityRestrict = oracleReaderWrapper.GetInt("IS_LOGIN_CITY_RESTRICT", 0);
+            o.IsLoginCityAllowGather = oracleReaderWrapper.GetString("IS_LOGIN_CITY_ALLOW_GATHER", "");
             return true;
         }
 
@@ -406,6 +453,82 @@
                 this.ReadInfo(reader, client);
             }
             return true;
+        }
+
+        /**
+         * 鍑芥暟鎻忚堪锛� 鏍规嵁瀹㈡埛ID鑾峰彇鍒嗛厤鐨勪釜鎬т骇鍝�
+         * clientId: 瀹㈡埛鎴稩D
+         * userType: 鐢ㄦ埛绫诲瀷锛�1-绠$悊鍛�;2-涓氬姟鍛�--鍏ㄥ憳;3-涓氬姟涓荤;4-涓氬姟鎬荤洃;5-瀹㈡湇浜哄憳;6-璐㈠姟浜哄憳;99-鍏朵粬
+         * return: SQL瀛楃涓�
+         * */
+
+        public Dictionary<string, GwProduct> GetPersonalityProduct(string clientId)
+        {
+            Dictionary<string, GwProduct> dictionary = new Dictionary<string, GwProduct>();
+            using (OracleDataReader reader = OracleHelper.ExecuteReader("SELECT * FROM GW_PRODUCT WHERE INSTR (CLIENT_IDS, :CLIENT_ID) > 0 ", OracleHelper.Connection, new OracleParameter(":CLIENT_ID", (object)clientId)))
+            {
+                while (reader != null && ((DbDataReader)reader).Read())
+                {
+                    OracleReaderWrapper oracleReaderWrapper = new OracleReaderWrapper(reader);
+                    string string1 = oracleReaderWrapper.GetString("ID", "");
+                    string string2 = oracleReaderWrapper.GetString("CLIENT_IDS", "");
+
+                    GwProduct o = new GwProduct();
+                    o.Id = string1;
+                    o.ClientIds = string2;
+
+                    dictionary[string1] = o;
+                }
+            }
+            return dictionary;
+        }
+
+        //淇敼鍒嗛厤涓�т骇鍝侊細淇敼纭
+        public void UpdateProduct(string clientId, string[] productIdArray)
+        {
+            List<KeyValuePair<string, OracleParameter[]>> list = new List<KeyValuePair<string, OracleParameter[]>>();
+            //鏇存柊涓�у垎閰嶅鎴烽泦鍘婚櫎鍖呭惈鏈鎴�
+            string key1 = " UPDATE GW_PRODUCT SET CLIENT_IDS=(REPLACE(REPLACE(REPLACE(CLIENT_IDS, ','||:CLIENT_ID), :CLIENT_ID||',' ), :CLIENT_ID ) )  WHERE INSTR (CLIENT_IDS, :CLIENT_ID) > 0 ";
+            OracleParameter[] oracleParameterArray1 = new OracleParameter[1]
+              {
+                new OracleParameter(":CLIENT_ID", (object) clientId)
+              };
+
+            list.Add(new KeyValuePair<string, OracleParameter[]>(key1, oracleParameterArray1));
+            OracleHelper.ExecuteSqlTran(list, OracleHelper.Connection);
+            if (productIdArray == null || productIdArray.Length <= 0)
+                return;
+
+            //鏇存柊涓�у垎閰嶅鎴烽泦闀垮害澶т簬0鏃�
+            string key2 = "UPDATE GW_PRODUCT SET CLIENT_IDS=:CLIENT_ID || ',' || CLIENT_IDS  WHERE (CLIENT_IDS IS NOT NULL AND LENGTH(CLIENT_IDS) > 0) AND ID=:PRODUCT_ID ";
+            foreach (string str in productIdArray)
+            {
+                OracleParameter[] oracleParameterArray2 = new OracleParameter[2]
+                {
+                  new OracleParameter(":CLIENT_ID", (object) clientId),
+                  new OracleParameter(":PRODUCT_ID", (object) str)
+                };
+
+                list = new List<KeyValuePair<string, OracleParameter[]>>();
+                list.Add(new KeyValuePair<string, OracleParameter[]>(key2, oracleParameterArray2));
+                OracleHelper.ExecuteSqlTran(list, OracleHelper.Connection);
+            }
+
+
+            //鏇存柊涓�у垎閰嶅鎴烽泦闀垮害涓�0鏃�
+            string key3 = "UPDATE GW_PRODUCT SET CLIENT_IDS=:CLIENT_ID WHERE (CLIENT_IDS IS NULL OR LENGTH(CLIENT_IDS) <= 0) AND ID=:PRODUCT_ID ";
+            foreach (string str in productIdArray)
+            {
+                OracleParameter[] oracleParameterArray2 = new OracleParameter[2]
+                {
+                  new OracleParameter(":CLIENT_ID", (object) clientId),
+                  new OracleParameter(":PRODUCT_ID", (object) str)
+                };
+
+                list = new List<KeyValuePair<string, OracleParameter[]>>();
+                list.Add(new KeyValuePair<string, OracleParameter[]>(key3, oracleParameterArray2));
+                OracleHelper.ExecuteSqlTran(list, OracleHelper.Connection);
+            }
         }
 
 
@@ -472,6 +595,7 @@
 
             return sqlStr;
         }
+
     }
 }
 
diff --git a/web/Dao/GwOrderDao.cs b/web/Dao/GwOrderDao.cs
index 1d1944e..44532b5 100644
--- a/web/Dao/GwOrderDao.cs
+++ b/web/Dao/GwOrderDao.cs
@@ -41,8 +41,9 @@
             {
                 StringBuilder stringBuilder = new StringBuilder();
                 stringBuilder.Append(" FROM ( ");
-                stringBuilder.Append("SELECT GWO.*, GWC.CLIENT_NAME, GWC.COMPANY  ");
+                stringBuilder.Append("SELECT GWO.*, GWC.CLIENT_NAME, GWC.COMPANY, GWOA.AUDITOR  ");
                 stringBuilder.Append(" FROM GW_ORDER GWO ");
+                stringBuilder.Append(" LEFT JOIN (select ORDER_ID, wm_concat(SU.USER_NAME) AUDITOR from (select ORDER_ID, AUDITOR FROM GW_ORDER_AUDIT order by ORDER_ID, AUDIT_SORT) GOA LEFT JOIN SYS_USER SU ON SU.ACCOUNT = GOA.AUDITOR group by ORDER_ID ) GWOA ON GWOA.ORDER_ID = GWO.ORDER_ID   ");
                 stringBuilder.Append(" LEFT JOIN GW_SP GWS ON GWS.SP_ID = GWO.SP_ID ");
                 stringBuilder.Append(" LEFT JOIN GW_CLIENT GWC ON GWC.CLIENT_ID = GWO.CLIENT_ID ");
                 stringBuilder.Append(" WHERE 1=1 ");
@@ -322,7 +323,7 @@
             o.BeforeBalanceNum = oracleReaderWrapper.GetInt("BEFORE_BALANCE_NUM", 0);
             o.Creator = oracleReaderWrapper.GetString("CREATOR", "");
             o.CreateTime = oracleReaderWrapper.GetDateTime("CREATE_TIME");
-            //o.Auditor = oracleReaderWrapper.GetString("AUDITOR", "");
+            o.Auditor = oracleReaderWrapper.GetString("AUDITOR", "");   //鍚勭骇瀹℃牳浜�
             //o.AuditTime = oracleReaderWrapper.GetDateTime("AUDIT_TIME");
             o.Status = oracleReaderWrapper.GetInt("STATUS", 0);
             o.Remark = oracleReaderWrapper.GetString("REMARK", "");
diff --git a/web/Lib/Dao.dll b/web/Lib/Dao.dll
index a7b22ce..969a278 100644
--- a/web/Lib/Dao.dll
+++ b/web/Lib/Dao.dll
Binary files differ
diff --git a/web/Lib/Dao.pdb b/web/Lib/Dao.pdb
index 49e31d1..4ea1d28 100644
--- a/web/Lib/Dao.pdb
+++ b/web/Lib/Dao.pdb
Binary files differ
diff --git a/web/Lib/Model.dll b/web/Lib/Model.dll
index 04bcab3..33cce63 100644
--- a/web/Lib/Model.dll
+++ b/web/Lib/Model.dll
Binary files differ
diff --git a/web/Lib/Model.pdb b/web/Lib/Model.pdb
index c28c4a9..ed58be0 100644
--- a/web/Lib/Model.pdb
+++ b/web/Lib/Model.pdb
Binary files differ
diff --git a/web/Model/Model/GwClient.cs b/web/Model/Model/GwClient.cs
index b701058..3452ccb 100644
--- a/web/Model/Model/GwClient.cs
+++ b/web/Model/Model/GwClient.cs
@@ -43,6 +43,31 @@
         public int ChargeType { get; set; } //璁¤垂鏂瑰紡锛�1-棰勪粯璐癸紱2-鍚庝粯璐�.
         public int SmsStatusReport { get; set; } //鐭俊鏄惁鏀寔鏄剧ず鐘舵�佹姤鍛婏細0-涓嶆樉绀�;1-鍙樉绀烘彁浜ゅけ璐ヤ负鍙戦�佸け璐ョ姸鎬�;2-鏄剧ず鍏ㄩ儴鐘舵�佺姸鎬�.
         public int MmsStatusReport { get; set; } //褰╀俊鏄惁鏀寔鏄剧ず鐘舵�佹姤鍛婏細0-涓嶆樉绀�;1-鍙樉绀烘彁浜ゅけ璐ヤ负鍙戦�佸け璐ョ姸鎬�;2-鏄剧ず鍏ㄩ儴鐘舵�佺姸鎬�.
+        public int IsEnableSubAccount{ get; set; } //鏄惁鏀寔鍒涘缓瀛愯处鎴凤細0-绂佺敤锛�1-鍚敤
+        public string SubAccountPath { get; set; } //瀛愯处鎴疯矾寰�
+        public int IsEnableWhite { get; set; } //鏄惁鍚敤鐧藉悕鍗�:0-绂佺敤锛�1-鍚敤銆傝繃婊ゅ鎴风櫧鍚嶅崟搴撱��
+        public int IsSyncChileWhite { get; set; } //鏄惁鍚屾瀛愯处鎴凤紙鐧藉悕鍗曪級:0-涓嶅悓姝ワ紱1-鍚屾銆�
+        public int IsEnableBlack { get; set; } //鏄惁鍚敤榛戝悕鍗�:0-绂佺敤锛�1-鍚敤銆傝繃婊ゅ鎴烽粦鍚嶅崟搴撳拰绯荤粺榛戝悕鍗曞簱銆�
+        public int IsSyncChileBlack { get; set; } //鏄惁鍚屾瀛愯处鎴凤紙榛戝悕鍗曪級:0-涓嶅悓姝ワ紱1-鍚屾銆�
+        public int IsRemoteLoginNotice { get; set; } //鏄惁寮傚湴鐧诲綍閫氱煡:0-绂佺敤锛�1-鍚敤
+        public int IsSyncChileRemoteLogin { get; set; } //鏄惁鍚屾瀛愯处鎴凤紙寮傚湴鐧诲綍閫氱煡锛�:0-涓嶅悓姝ワ紱1-鍚屾銆�
+        public int IsMobileCaptcha { get; set; } //鏄惁鍚敤鎵嬫満楠岃瘉鐮�:0-绂佺敤锛�1-鍚敤
+        public int IsSyncChileMobileCaptcha { get; set; } //鏄惁鍚屾瀛愯处鎴凤紙鎵嬫満楠岃瘉鐮侊級:0-涓嶅悓姝ワ紱1-鍚屾銆�
+        public int IsHideMobile { get; set; } //鏄惁闅愯棌瀹㈡埛绔墜鏈哄彿:0-绂佺敤锛�1-鍚敤
+        public int IsSyncChileHideMobile { get; set; } //鏄惁鍚屾瀛愯处鎴凤紙闅愯棌瀹㈡埛绔墜鏈哄彿锛�:0-涓嶅悓姝ワ紱1-鍚屾銆�
+        public int IsDisplayStatus { get; set; } //鏄惁鏄剧ず鐘舵�佹帴鍙�: 涓嶆樉绀�-0 鍙樉绀烘彁浜ゅけ璐ヤ负鍙戦�佸け璐ョ姸鎬�-1 鏄剧ず鍏ㄩ儴鐘舵�佺姸鎬�-2
+        public int IsSyncChileDisplayStatus { get; set; } //鏄惁鍚屾瀛愯处鎴凤紙鏄剧ず鐘舵�侊級:0-涓嶅悓姝ワ紱1-鍚屾銆�
+        public int IsLoginIpRestrict { get; set; } //鏄惁鍚敤鐧诲綍IP闄愬埗:0-绂佺敤锛�1-鍚敤
+        public int IsSyncChileLoginIpRestrict { get; set; } //鏄惁鍚屾瀛愯处鎴凤紙鐧诲綍IP闄愬埗锛�:0-涓嶅悓姝ワ紱1-鍚屾銆�
+        public string IsLoginIpAllowGather { get; set; } //鐧诲綍IP鍏佽闆嗗悎:閰嶅悎鏄惁鍚敤鐧诲綍IP闄愬埗涓�璧蜂娇鐢紝澶氫釜闄愬埗IP鏃讹紝鎸夊崐瑙掗�楀彿","鍒嗛殧銆傚彲浣跨敤IP娈碉紝濡傦細202.203.1.*銆�
+        public int IsSyncChileIpAllows { get; set; } //鏄惁鍚屾瀛愯处鎴凤紙IP鍏佽闆嗗悎锛�:0-涓嶅悓姝ワ紱1-鍚屾銆�
+        public int IsLoginCityRestrict { get; set; } //鏄惁鍚敤鐧诲綍鍦板尯锛堝煄甯傦級闄愬埗:0-绂佺敤锛�1-鍚敤
+        public int IsSyncChileCityRestrict { get; set; } //鏄惁鍚屾瀛愯处鎴凤紙鐧诲綍鍩庡競闄愬埗锛�:0-涓嶅悓姝ワ紱1-鍚屾銆�
+        public string IsLoginCityAllowGather { get; set; } //鐧诲綍鍦板尯锛堝煄甯傦級鍏佽闆嗗悎锛�:閰嶅悎鏄惁鍚敤鐧诲綍鍩庡競闄愬埗涓�璧蜂娇鐢紝澶氫釜闄愬埗鍦板尯鏃讹紝鎸夊崐瑙掗�楀彿","鍒嗛殧銆�
+        public int IsSyncChileCityAllows { get; set; } //鏄惁鍚屾瀛愯处鎴凤紙鍩庡競鍏佽闆嗗悎锛�:0-涓嶅悓姝ワ紱1-鍚屾銆�
+        public string LastLoginIp { get; set; } //鏈�鍚庣櫥褰旾P
+        public string LastLoginCity { get; set; } //鏈�鍚庣櫥褰曞湴鍖猴紙鍩庡競锛夌紪鐮�
+        public DateTime LastLoginTime { get; set; } //鏈�鍚庣櫥褰曟椂闂�
 
 
         public int Id
@@ -174,6 +199,10 @@
 
         public string AlarmMobile { get; set; }
 
+        //宸插垎閰嶇殑涓�т骇鍝侀泦锛屽涓互鈥�,鈥濆垎闅�
+        public string ProductIds { get; set; }
+        
+
         public string PermissionData
         {
             get
diff --git a/web/Model/Model/GwOrder.cs b/web/Model/Model/GwOrder.cs
index aff3798..f8ed56d 100644
--- a/web/Model/Model/GwOrder.cs
+++ b/web/Model/Model/GwOrder.cs
@@ -37,6 +37,10 @@
 
         public string Creator { get; set; }
 
+        //鍚勭骇瀹℃牳浜虹粍鍚堬紝浠ュ崐瑙掗�楀彿鍒嗛殧銆�
+        public string Auditor { get; set; }
+        
+
         public DateTime CreateTime { get; set; }
 
         //0-寰呭鏍革紙宸叉彁浜わ級锛�1-瀹℃牳涓紱2-瀹℃牳涓嶉�氳繃锛�3-瀹℃牳涓嶉�氳繃锛�4-鍙栨秷锛�
@@ -44,5 +48,8 @@
         public int Status { get; set; }
 
         public string Remark { get; set; }
-  }
+
+        //瀹㈡埛浣欓
+        public long Balance { get; set; }
+    }
 }
diff --git a/web/web/Bin/Dao.dll b/web/web/Bin/Dao.dll
index a7b22ce..969a278 100644
--- a/web/web/Bin/Dao.dll
+++ b/web/web/Bin/Dao.dll
Binary files differ
diff --git a/web/web/Bin/Dao.pdb b/web/web/Bin/Dao.pdb
index 49e31d1..4ea1d28 100644
--- a/web/web/Bin/Dao.pdb
+++ b/web/web/Bin/Dao.pdb
Binary files differ
diff --git a/web/web/Bin/Model.dll b/web/web/Bin/Model.dll
index 04bcab3..33cce63 100644
--- a/web/web/Bin/Model.dll
+++ b/web/web/Bin/Model.dll
Binary files differ
diff --git a/web/web/Bin/Model.pdb b/web/web/Bin/Model.pdb
index c28c4a9..ed58be0 100644
--- a/web/web/Bin/Model.pdb
+++ b/web/web/Bin/Model.pdb
Binary files differ
diff --git a/web/web/GwAuditCache.aspx b/web/web/GwAuditCache.aspx
index b4c14df..d579477 100644
--- a/web/web/GwAuditCache.aspx
+++ b/web/web/GwAuditCache.aspx
@@ -41,47 +41,47 @@
                 value="10" /><label>寰呬簩娆¢壌瀹氫俊鎭�</label>&nbsp;<input type="button" value="鍒锋柊" class="btn btn-primary   action-go" />
         </div>
     </div>
-    <div class="form-group">
-        <div class="input-group m-b">&nbsp
+    </form>
+    <div class="table-responsive">
             <input class="btn btn-success action-modal-approve" data-status="4" value="鎵归噺閫氳繃(鍙慨鏀归�氶亾)"
                 type="button" />&nbsp
             <input class="btn btn-danger  action-audit-all" data-status="4" value="鐩存帴鎵归噺閫氳繃"
                 type="button" />&nbsp
             <input class="btn btn-warning  action-audit-all" data-status="5" value="鐩存帴鎵归噺鎷掔粷"
                 type="button" />
-        </div>
+        <table class="table table-striped table-bordered table-hover" id="cacheTable">
+        <thead>
+            <tr class="header">
+                <th style="width: 20px">
+                    <input type="checkbox" name='checkAll' id="checkAll" />
+                </th>
+                <th style="width: 50px">
+                    璐﹀彿
+                </th>
+                <th>
+                    閫氶亾
+                </th>
+                <th>
+                    鍐呭
+                </th>
+                <th>
+                    鍏抽敭瀛�
+                </th>
+                <th>
+                    鏉℃暟
+                </th>
+                <th style="width: 200px">
+                    鎿嶄綔
+                </th>
+            </tr>
+            </thead>
+            <tbody>
+            </tbody>
+        </table>
     </div>
-    </form>
-    <table class="table table-striped table-bordered table-hover" id="cacheTable">
-    <thead>
-        <tr class="header">
-            <th style="width: 20px">
-                <input type="checkbox" name='checkAll' id="checkAll" />
-            </th>
-            <th style="width: 50px">
-                璐﹀彿
-            </th>
-            <th>
-                閫氶亾
-            </th>
-            <th>
-                鍐呭
-            </th>
-            <th>
-                鍏抽敭瀛�
-            </th>
-            <th>
-                鏉℃暟
-            </th>
-            <th style="width: 200px">
-                鎿嶄綔
-            </th>
-        </tr>
-        </thead>
-        <tbody>
-        </tbody>
-    </table>
-    <div id="pager"></div>
+    <div id="pager">
+    </div>
+
     <div class="modal inmodal " id="opDialog" tabindex="-1" role="dialog" aria-hidden="true">
         <div class="modal-dialog modal-sm">
             <div class="modal-content">
diff --git a/web/web/GwClient.ashx b/web/web/GwClient.ashx
index 70a909e..47443d7 100644
--- a/web/web/GwClient.ashx
+++ b/web/web/GwClient.ashx
@@ -29,7 +29,7 @@
     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;
@@ -70,6 +70,21 @@
             //閲嶇疆瀵嗙爜
             case "resetPwd":
                 return ResetPwd(context);
+            //淇敼瀵嗙爜
+            case "updatePwd":
+                return UpdatePwd(context);
+            //鑾峰彇瀹㈡埛鍒嗛厤涓�т骇鍝�
+            case "getPersonalityProduct":
+                return GetPersonalityProduct(context);
+            //淇敼鍒嗛厤涓�т骇鍝�
+            case "updateProduct":
+                return UpdateProduct(context);
+            //鍚敤鎴栧仠鐢�
+            case "updateStatus":
+                return UpdateStatus(context);
+            //鑾峰彇Token锛氭湭瀹炵幇鐢熸垚Token
+            case "getToken":
+                return GetToken(context);
 
             default:
                 throw new Exception("Invalid Action=" + action);
@@ -93,6 +108,7 @@
         string Salesman = context.GetString("Salesman");
         string SupportStaff = context.GetString("SupportStaff");
         string ProductId = context.GetString("ProductId");
+        int IsEnable = context.GetInt("IsEnable", -1);
         int pageIndex = context.GetInt("pageIndex", 1);
 
         string Agent = context.GetString("Agent");
@@ -104,8 +120,8 @@
         string str = "";
         using (GwClientDao dao = new GwClientDao())
         {
-            string permissionsSQL = dao.GetClientPermissions(_userId, _userType, null);
-            var list = dao.LoadInfoList(out recordCount, pageIndex, pageSize, ClientID, ClientName, Telephone, Agent, Company, Salesman, SupportStaff, ProductId, permissionsSQL);
+            string permissionsSQL = dao.GetClientPermissions(_userId, _userType, "gwc");
+            var list = dao.LoadInfoList(out recordCount, pageIndex, pageSize, ClientID, ClientName, Telephone, Agent, Company, Salesman, SupportStaff, ProductId, IsEnable, permissionsSQL);
 
             if (list != null && list.Count > 0)
             {
@@ -120,39 +136,79 @@
                     //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  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 += @"<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>";
+                    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>" + item.ProductIds + "</td>"
+                            + "<td>"+ (item.Is_Enable == 1 ? "<span class='label label-primary'>鍚敤</span>" : "<span class='label label-default'>鍋滅敤</span>") + "</td>";
 
                     str += @"<td>";
-                    string loginStr = "http://" + serverIp + ":" + clientPort + "/Attachedlogin.aspx?action=Attachedlogin&account=" + item.Account + "&password=" + item.Password;
-                    str += string.Format("<a class=\"action-modal-login btn btn-success btn-xs \" href=\"{0}\" data-id=\"{1}\" target=\"_blank\">", (object)loginStr, (object)item.ClientID);
-                    str += "&nbsp;鐧诲綍</a>&nbsp;";
+                        
+                    if (item.Is_Enable == 1)
+                    {
+                        //string loginStr = "http://" + serverIp + ":" + clientPort + "/Attachedlogin.aspx?action=Attachedlogin&account=" + item.Account + "&password=" + item.Password;
+                        string loginStr = "http://" + serverIp + ":" + clientPort + "/Attachedlogin.aspx?action=Attachedlogin&account=" + item.Account ;
+                        str += string.Format("<a class=\"action-modal-login btn btn-success btn-xs \" href=\"javascript:;\" data-url=\"{0}\" data-id=\"{1}\" target=\"_blank\">", (object)loginStr, (object)item.ClientID);
+                        str += "&nbsp;鐧诲綍</a>&nbsp;";
 
-                    str += string.Format(@"<a class=""action-modal-edit btn btn-xs btn-primary"" href=""javascript:;"" data-id=""{0}"">", item.ClientID);
-                    str += @"缂栬緫";
+                        str += string.Format(@"<a class=""action-modal-edit btn btn-xs btn-primary"" href=""javascript:;"" data-id=""{0}"">", item.ClientID);
+                        str += @"缂栬緫";
+                        str += @"</a>&nbsp;";
+
+                        str += string.Format(@"<a class=""action-modal-white btn btn-xs btn-primary"" href=""javascript:;"" data-id=""{0}"">", item.ClientID);
+                        str += @"鐧藉悕鍗�";
+                        str += @"</a>&nbsp;";
+
+                        str += string.Format(@"<a class=""action-modal-black btn btn-xs btn-primary"" href=""javascript:;"" data-id=""{0}"">", item.ClientID);
+                        str += @"榛戝悕鍗�";
+                        str += @"</a>&nbsp;";
+
+                        //str += string.Format(@"<a class=""action-modal-resetPwd btn btn-xs btn-primary"" href=""javascript:;"" data-id=""{0}"">", item.ClientID);
+                        //str += @"閲嶇疆瀵嗙爜";
+                        //str += @"</a>&nbsp;";
+
+                        str += string.Format(@"<a class=""action-modal-updatePwd btn btn-xs btn-primary"" href=""javascript:;"" data-id=""{0}"">", item.ClientID);
+                        str += @"淇敼瀵嗙爜";
+                        str += @"</a>&nbsp;";
+
+                        str += string.Format(@"<a class=""action-modal-updateProduct btn btn-xs btn-primary"" href=""javascript:;"" data-id=""{0}"">", item.ClientID);
+                        str += @"淇敼浜у搧";
+                        str += @"</a>&nbsp;";
+
+                        str += string.Format(@"<a class=""action-modal-orderCreate btn btn-xs btn-primary"" href=""javascript:;"" data-id=""{0}"">", item.ClientID);
+                        str += @"鍏呭��";
+                        str += @"</a>&nbsp;";
+                    }
+
+                    str += string.Format(@"<a class=""action-modal-orderLog btn btn-xs btn-primary"" href=""javascript:;"" data-id=""{0}"">", item.ClientID);
+                    str += @"鍏呭�兼棩蹇�";
                     str += @"</a>&nbsp;";
 
-                    str += string.Format(@"<a class=""action-modal-white btn btn-xs btn-primary"" href=""javascript:;"" data-id=""{0}"">", item.ClientID);
-                    str += @"鐧藉悕鍗�";
-                    str += @"</a>&nbsp;";
+                    if(item.Is_Enable == 1)
+                    {
+                        str += string.Format(@"<a class=""action-modal-updateStatus btn btn-xs btn-default"" href=""javascript:;"" data-id=""{0}"" data-status=0 >", item.ClientID);
+                        str += @"<i class='fa fa-toggle-on'></i>鍋滅敤</a>&nbsp;";
 
-                    str += string.Format(@"<a class=""action-modal-black btn btn-xs btn-primary"" href=""javascript:;"" data-id=""{0}"">", item.ClientID);
-                    str += @"榛戝悕鍗�";
-                    str += @"</a>&nbsp;";
+                    }
+                    else
+                    {
+                        str += string.Format(@"<a class=""action-modal-updateStatus btn btn-xs btn-primary"" href=""javascript:;"" data-id=""{0}"" data-status=1 >", item.ClientID);
+                        str += @"<i class='fa fa-toggle-off'></i>鍚敤</a>&nbsp;";
 
-                    str += string.Format(@"<a class=""action-modal-resetPwd btn btn-xs btn-primary"" href=""javascript:;"" data-id=""{0}"">", item.ClientID);
-                    str += @"閲嶇疆瀵嗙爜";
-                    str += @"</a>&nbsp;";
+                    }
 
-                    str += string.Format(@"<a class=""action-delete btn btn-xs btn-default"" href=""javascript:;"" data-id=""{0}"">", item.ClientID);
-                    str += @"鍒犻櫎";
-                    str += @"</a>";
+                    if (item.Is_Enable == 0)
+                    {
+                        str += string.Format(@"<a class=""action-delete btn btn-xs btn-default"" href=""javascript:;"" data-id=""{0}"">", item.ClientID);
+                        str += @"鍒犻櫎";
+                        str += @"</a>";
+                    }
+
                     str += @"</td>";
                     str += @"</tr>";
                 }
             }
             else
             {
-                str += @"<tr><td colspan=""9"">鏆傛棤淇℃伅</td></tr>";
+                str += @"<tr><td colspan=""11"">鏆傛棤淇℃伅</td></tr>";
             }
 
         }
@@ -227,7 +283,23 @@
         return new JsonPageResult(true, _Dao.GetBlackList(clientID));
     }
 
-        //閲嶇疆瀵嗙爜
+    //鏍规嵁瀹㈡埛璐﹀彿鐢熸垚Token
+    private JsonPageResult GetToken(PageContext<Model.SysUser> context)
+    {
+        string clientID = context.GetString("clientID");
+        if (string.IsNullOrEmpty(clientID) )
+        {
+            throw new ArgumentException("瀹㈡埛璐﹀彿鍙傛暟寮傚父锛�");
+        }
+
+        //鐢熸垚Token
+        string token = clientID;
+
+        return new JsonPageResult(true, token);
+    }
+
+
+    //閲嶇疆瀵嗙爜
     private JsonPageResult ResetPwd(PageContext<Model.SysUser> context)
     {
         string clientID = context.GetString("clientID");
@@ -239,6 +311,59 @@
         _Dao.UpdatePassword(clientID, password);
 
         return new JsonPageResult(true, "閲嶇疆瀵嗙爜鎴愬姛锛�");
+    }
+
+    //淇敼瀵嗙爜
+    private JsonPageResult UpdatePwd(PageContext<Model.SysUser> context)
+    {
+        string clientID = context.GetString("clientID");
+        string newPwd = context.GetString("newPwd");
+
+        if (string.IsNullOrEmpty(newPwd) || !System.Text.RegularExpressions.Regex.IsMatch(newPwd, @"[a-zA-Z0-9]{4,10}"))
+        {
+            throw new ArgumentException("鐧诲綍瀵嗙爜涓嶈兘涓虹┖锛屼笖蹇呴』涓�4-10浣嶈嫳鏂囨垨鏁板瓧瀛楃缁勫悎锛�");
+        }
+
+        //瀵嗙爜MD5鍔犲瘑锛�
+        newPwd = DataHelper.MD5Hex(newPwd);
+
+        _Dao.UpdatePassword(clientID, newPwd);
+
+        return new JsonPageResult(true, "淇敼瀵嗙爜鎴愬姛锛�");
+    }
+
+    //鑾峰彇瀹㈡埛涓�т骇鍝�
+    private JsonPageResult GetPersonalityProduct(PageContext<Model.SysUser> context)
+    {
+        string clientId = context.GetString("clientId");
+
+        return new JsonPageResult(true, _Dao.GetPersonalityProduct(clientId).Keys);
+    }
+
+    //淇敼鍒嗛厤涓�т骇鍝侊細淇敼纭
+    private JsonPageResult UpdateProduct(PageContext<SysUser> context)
+    {
+        //context.CheckRight("1042", FailedOperation.PromptOnly);
+        string @string = context.GetString("productIdArray");
+        string clientId = context.GetString("clientId");
+        string[] productIdArray = JsonConvert.DeserializeObject<string[]>(@string);
+        if (productIdArray == null)
+            throw new ArgumentException("涓�у垎閰嶄骇鍝佹暟鎹紓甯革紒");
+        if (string.IsNullOrEmpty(clientId) )
+            throw new ArgumentException("瀹㈡埛璐﹀彿鍙傛暟寮傚父锛�");
+        this._Dao.UpdateProduct(clientId, productIdArray);
+        return new JsonPageResult(true, (object) "淇敼鍒嗛厤涓�т骇鍝佹垚鍔燂紒");
+    }
+
+    //鏇存柊淇℃伅鍚敤鎴栧仠鐢�
+    private JsonPageResult UpdateStatus(PageContext<SysUser> context)
+    {
+        string clientId = context.GetString("clientId");
+        string isEnable = context.GetString("isEnable");
+
+        this._Dao.UpdateStatus(clientId, isEnable);
+        return new JsonPageResult(true, "鏇存柊淇℃伅鐘舵�佹垚鍔燂紒");
+
     }
 
     /// <summary>
@@ -292,6 +417,18 @@
         string chargeType = context.GetString("chargeType");
         string smsStatusReport = context.GetString("smsStatusReport");
         string mmsStatusReport = context.GetString("mmsStatusReport");
+            
+        string isEnableWhite = context.GetString("isEnableWhite");
+        string isEnableBlack = context.GetString("isEnableBlack");
+        string isRemoteLoginNotice = context.GetString("isRemoteLoginNotice");
+        string isMobileCaptcha = context.GetString("isMobileCaptcha");
+        string isHideMobile = context.GetString("isHideMobile");
+        string isDisplayStatus = context.GetString("isDisplayStatus");
+        string isLoginIpRestrict = context.GetString("isLoginIpRestrict");
+        string isLoginIpAllowGather = context.GetString("isLoginIpAllowGather");
+        string isLoginCityRestrict = context.GetString("isLoginCityRestrict");
+        string isLoginCityAllowGather = context.GetString("isLoginCityAllowGather");
+
         string data = context.GetString("permissionData");
         if(data.Contains("1"))
         {
@@ -308,10 +445,11 @@
             throw new ArgumentException("瀹㈡埛璐﹀彿涓嶈兘涓虹┖锛屼笖蹇呴』涓哄叕鍙稿悕绉帮紒");
         }
 
+        /**
         if (string.IsNullOrEmpty(password) || !System.Text.RegularExpressions.Regex.IsMatch(password, @"[a-zA-Z0-9]{4,10}"))
         {
             throw new ArgumentException("瀹㈡埛瀵嗙爜涓嶈兘涓虹┖锛屼笖蹇呴』涓�4-10浣嶈嫳鏂囨垨鏁板瓧瀛楃缁勫悎锛�");
-        }
+        }**/
 
         if (string.IsNullOrEmpty(clientName) || string.IsNullOrEmpty(telephone))
         {
@@ -348,11 +486,14 @@
             throw new ArgumentException("鐭俊鏄惁鏀寔鏄剧ず鐘舵�佹姤鍛婁笉鑳戒负绌猴紝璇烽�夋嫨锛�");
         }
 
+        /**
         if (string.IsNullOrEmpty(mmsStatusReport))
         {
             throw new ArgumentException("褰╀俊鏄惁鏀寔鏄剧ず鐘舵�佹姤鍛婁笉鑳戒负绌猴紝璇烽�夋嫨锛�");
-        }
+        }**/
 
+        /**
+        //缂栬緫鏃朵笉鏀寔涓�у瘑鐮�
         string savePassword = "";
         if (!string.IsNullOrEmpty(clientID))
         {
@@ -364,6 +505,7 @@
             savePassword = DataHelper.MD5Hex(password);
         }
 
+        **/
 
         var client = new Model.GwClient();
 
@@ -371,7 +513,7 @@
         client.ClientID = clientID;
         client.Company = company;
         //client.Password = password;
-        client.Password = savePassword;
+        //client.Password = savePassword;
 
         client.ClientName = clientName;
         client.Address = address;
@@ -386,6 +528,18 @@
         client.ChargeType = string.IsNullOrEmpty(chargeType) ? 0 : int.Parse(chargeType);
         client.SmsStatusReport = string.IsNullOrEmpty(smsStatusReport) ? 0 : int.Parse(smsStatusReport);
         client.MmsStatusReport = string.IsNullOrEmpty(mmsStatusReport) ? 0 : int.Parse(mmsStatusReport);
+            
+        client.IsEnableWhite = string.IsNullOrEmpty(isEnableWhite) ? 0 : int.Parse(isEnableWhite);
+        client.IsEnableBlack = string.IsNullOrEmpty(isEnableBlack) ? 0 : int.Parse(isEnableBlack);
+        client.IsRemoteLoginNotice = string.IsNullOrEmpty(isRemoteLoginNotice) ? 0 : int.Parse(isRemoteLoginNotice);
+        client.IsMobileCaptcha = string.IsNullOrEmpty(isMobileCaptcha) ? 0 : int.Parse(isMobileCaptcha);
+        client.IsHideMobile = string.IsNullOrEmpty(isHideMobile) ? 0 : int.Parse(isHideMobile);
+        client.IsDisplayStatus = string.IsNullOrEmpty(isDisplayStatus) ? 0 : int.Parse(isDisplayStatus);
+        client.IsLoginIpRestrict = string.IsNullOrEmpty(isLoginIpRestrict) ? 0 : int.Parse(isLoginIpRestrict);
+        client.IsLoginIpAllowGather = isLoginIpAllowGather;
+        client.IsLoginCityRestrict = string.IsNullOrEmpty(isLoginCityRestrict) ? 0 : int.Parse(isLoginCityRestrict);
+        client.IsLoginCityAllowGather = isLoginCityAllowGather;
+                        
         client.PermissionData = permissionData;
 
         _Dao.Update(client);
@@ -410,7 +564,19 @@
         string financialStaff = context.GetString("financialStaff");
         string chargeType = context.GetString("chargeType");
         string smsStatusReport = context.GetString("smsStatusReport");
-        string mmsStatusReport = context.GetString("mmsStatusReport");
+        string mmsStatusReport = context.GetString("mmsStatusReport");            
+            
+        string isEnableWhite = context.GetString("isEnableWhite");
+        string isEnableBlack = context.GetString("isEnableBlack");
+        string isRemoteLoginNotice = context.GetString("isRemoteLoginNotice");
+        string isMobileCaptcha = context.GetString("isMobileCaptcha");
+        string isHideMobile = context.GetString("isHideMobile");
+        string isDisplayStatus = context.GetString("isDisplayStatus");
+        string isLoginIpRestrict = context.GetString("isLoginIpRestrict");
+        string isLoginIpAllowGather = context.GetString("isLoginIpAllowGather");
+        string isLoginCityRestrict = context.GetString("isLoginCityRestrict");
+        string isLoginCityAllowGather = context.GetString("isLoginCityAllowGather");
+
         string data = context.GetString("permissionData");
         if(data.Contains("1"))
         {
@@ -476,11 +642,11 @@
         {
             throw new ArgumentException("鐭俊鏄惁鏀寔鏄剧ず鐘舵�佹姤鍛婁笉鑳戒负绌猴紝璇烽�夋嫨锛�");
         }
-
+        /**
         if (string.IsNullOrEmpty(mmsStatusReport))
         {
             throw new ArgumentException("褰╀俊鏄惁鏀寔鏄剧ず鐘舵�佹姤鍛婁笉鑳戒负绌猴紝璇烽�夋嫨锛�");
-        }
+        }**/
 
         HttpFileCollection _file = HttpContext.Current.Request.Files;
         if (_file.Count > 0)
@@ -547,7 +713,18 @@
         client.FinancialStaff = financialStaff;
         client.ChargeType = string.IsNullOrEmpty(chargeType) ? 0 : int.Parse(chargeType);
         client.SmsStatusReport = string.IsNullOrEmpty(smsStatusReport) ? 0 : int.Parse(smsStatusReport);
-        client.MmsStatusReport = string.IsNullOrEmpty(mmsStatusReport) ? 0 : int.Parse(mmsStatusReport);
+        client.MmsStatusReport = string.IsNullOrEmpty(mmsStatusReport) ? 0 : int.Parse(mmsStatusReport);            
+            
+        client.IsEnableWhite = string.IsNullOrEmpty(isEnableWhite) ? 0 : int.Parse(isEnableWhite);
+        client.IsEnableBlack = string.IsNullOrEmpty(isEnableBlack) ? 0 : int.Parse(isEnableBlack);
+        client.IsRemoteLoginNotice = string.IsNullOrEmpty(isRemoteLoginNotice) ? 0 : int.Parse(isRemoteLoginNotice);
+        client.IsMobileCaptcha = string.IsNullOrEmpty(isMobileCaptcha) ? 0 : int.Parse(isMobileCaptcha);
+        client.IsHideMobile = string.IsNullOrEmpty(isHideMobile) ? 0 : int.Parse(isHideMobile);
+        client.IsDisplayStatus = string.IsNullOrEmpty(isDisplayStatus) ? 0 : int.Parse(isDisplayStatus);
+        client.IsLoginIpRestrict = string.IsNullOrEmpty(isLoginIpRestrict) ? 0 : int.Parse(isLoginIpRestrict);
+        client.IsLoginIpAllowGather = isLoginIpAllowGather;
+        client.IsLoginCityRestrict = string.IsNullOrEmpty(isLoginCityRestrict) ? 0 : int.Parse(isLoginCityRestrict);
+        client.IsLoginCityAllowGather = isLoginCityAllowGather;
 
         _Dao.Add(client);//鎻掑叆鏁版嵁搴撱�傚垱寤鸿处鎴�
 
diff --git a/web/web/GwClient.aspx b/web/web/GwClient.aspx
index b148960..735e510 100644
--- a/web/web/GwClient.aspx
+++ b/web/web/GwClient.aspx
@@ -3,7 +3,7 @@
 <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
     <%--<link href="css/plugins/bootstrap-fileinput/fileinput.min.css" rel="stylesheet"/>
     <script src="js/plugins/bootstrap-fileinput/fileinput.min.js" type="text/javascript"></script>--%>
-    <script>
+    <script type="text/javascript">
         $(function () {
 
             $("#pager").Pager({
@@ -22,10 +22,11 @@
                 var Salesman = $("#Salesman").val();
                 var SupportStaff = $("#SupportStaff").val();
                 var ProductId = $("#ProductId").val();
+                var IsEnable = <%=IsEnable%>;
                 $.ajax({
                     url: "GwClient.ashx",
                     type: "POST",
-                    data: { action: "loadGwClientPageList", ClientID: ClientID, Company: Company, ClientName: ClientName, Telephone: Telephone, Agent: Agent, Salesman: Salesman, SupportStaff: SupportStaff, ProductId: ProductId , pageSize: $("#pager").Pager("getPageSize"), pageIndex: $("#pager").Pager("getPageIndex") },
+                    data: { action: "loadGwClientPageList", ClientID: ClientID, Company: Company, ClientName: ClientName, Telephone: Telephone, Agent: Agent, Salesman: Salesman, SupportStaff: SupportStaff, ProductId: ProductId, IsEnable: IsEnable , pageSize: $("#pager").Pager("getPageSize"), pageIndex: $("#pager").Pager("getPageIndex") },
                     success: function (result) {
                         if (result.OK) {
                             $("#gwclientTable tbody").html(result.Message.Table);
@@ -57,7 +58,7 @@
                 loadPageList();
 
                 $(document).on("click", ".action-modal-create", function () {
-                    $("#clientDialog .modal-title").text("鍒涘缓瀹㈡埛璐︽埛");
+                    $("#clientDialog .modal-title").text("鍒涘缓瀹㈡埛淇℃伅");
                     $("#clientDialog input").attr("readonly", false);
                     $("#clientDialog input[name=action]").val("save");
 
@@ -83,12 +84,11 @@
                     //鍒锋柊涓�娆¢殢鏈哄瘑鐮�
                     $("#password").val(randomString(8));
 
+                    $(".pwdCss").show();
+
                 });
 
-                $(document).on("click", ".action-generate-password", function () {
-                    $("#password").val(randomString(8));
-                });
-
+                //缂栬緫
                 $(document).on("click", ".action-modal-edit", function () {
                     $("#clientDialog .modal-title").text("淇敼瀹㈡埛璧勬枡");
                     $("#clientDialog input[name=action]").val("update");
@@ -99,7 +99,11 @@
                                 $("#clientDialog #id").val(r.Message.Id);
                                 $("#clientDialog #clientID").val(r.Message.ClientID);
                                 $("#clientDialog #company").val(r.Message.Company);
-                                $("#clientDialog #password").val(r.Message.Password); 
+                                //$("#clientDialog #password").val(r.Message.Password);
+                                $("#clientDialog #password").val("");
+                                //缂栬緫鏃跺瘑鐮佹闅愯棌
+                                $(".pwdCss").hide();
+                                
                                 $("#clientDialog #clientName").val(r.Message.ClientName);
                                 $("#clientDialog #agent").val(r.Message.Agent);
                                 $("#clientDialog #address").val(r.Message.Address);
@@ -117,6 +121,35 @@
                                 $.each(permissionData, function (i) {
                                     $("#clientDialog input[name=permissionData][value='" + this + "']").iCheck("check");
                                 });
+
+                                //$("#clientDialog #isEnableWhite").val(r.Message.IsEnableWhite);
+                                $("#clientDialog input[name=isEnableWhite]").iCheck("uncheck");
+                                $("#clientDialog input[name=isEnableWhite][value='" + r.Message.IsEnableWhite + "']").iCheck("check");
+
+                                //$("#clientDialog #isEnableBlack").val(r.Message.IsEnableBlack);
+                                $("#clientDialog input[name=isEnableBlack]").iCheck("uncheck");
+                                $("#clientDialog input[name=isEnableBlack][value='" + r.Message.IsEnableBlack + "']").iCheck("check");
+                                //$("#clientDialog #isRemoteLoginNotice").val(r.Message.IsRemoteLoginNotice);
+                                $("#clientDialog input[name=isRemoteLoginNotice]").iCheck("uncheck");
+                                $("#clientDialog input[name=isRemoteLoginNotice][value='" + r.Message.IsRemoteLoginNotice + "']").iCheck("check");
+                                //$("#clientDialog #isMobileCaptcha").val(r.Message.IsMobileCaptcha);
+                                $("#clientDialog input[name=isMobileCaptcha]").iCheck("uncheck");
+                                $("#clientDialog input[name=isMobileCaptcha][value='" + r.Message.IsMobileCaptcha + "']").iCheck("check");
+                                //$("#clientDialog #isHideMobile").val(r.Message.IsHideMobile);
+                                $("#clientDialog input[name=isHideMobile]").iCheck("uncheck");
+                                $("#clientDialog input[name=isHideMobile][value='" + r.Message.IsHideMobile + "']").iCheck("check");
+                                //$("#clientDialog #isDisplayStatus").val(r.Message.IsDisplayStatus);
+                                $("#clientDialog input[name=isDisplayStatus]").iCheck("uncheck");
+                                $("#clientDialog input[name=isDisplayStatus][value='" + r.Message.IsDisplayStatus + "']").iCheck("check");
+                                //$("#clientDialog #isLoginIpRestrict").val(r.Message.IsLoginIpRestrict);
+                                $("#clientDialog input[name=isLoginIpRestrict]").iCheck("uncheck");
+                                $("#clientDialog input[name=isLoginIpRestrict][value='" + r.Message.IsLoginIpRestrict + "']").iCheck("check");
+
+                                $("#clientDialog #isLoginIpAllowGather").val(r.Message.IsLoginIpAllowGather);
+                                //$("#clientDialog #isLoginCityRestrict").val(r.Message.IsLoginCityRestrict);
+                                $("#clientDialog input[name=isLoginCityRestrict]").iCheck("uncheck");
+                                $("#clientDialog input[name=isLoginCityRestrict][value='" + r.Message.IsLoginCityRestrict + "']").iCheck("check");
+                                $("#clientDialog #isLoginCityAllowGather").val(r.Message.IsLoginCityAllowGather);
                             }
                             catch (e) {
                             }
@@ -129,6 +162,20 @@
                     }, "json");
                 });
 
+                //鍏嶅瘑鐧诲綍
+                $(document).on("click", ".action-modal-login", function () {
+                    var url = $(this).data("url");
+                    var id = $(this).data("id");
+
+                    var milliseconds = new Date().getTime();    //鑾峰緱褰撳墠鏃堕棿鐨勬绉掑��
+                    url += "&t=" + milliseconds;
+                    //console.log(url);
+                    window.open(url, "_blank");
+
+
+                });
+
+                //榛戝悕鍗�
                 $(document).on("click", ".action-modal-black", function () {
                     var id = $(this).data("id");
                     $.get("gwclient.ashx?action=getBlack", { clientID: id }, function (r) {
@@ -143,6 +190,7 @@
                     }, "json");
                 });
 
+                //鐧藉悕鍗�
                 $(document).on("click", ".action-modal-white", function () {
                     var id = $(this).data("id");
                     $.get("gwclient.ashx?action=getWhite", { clientID: id }, function (r) {
@@ -157,6 +205,120 @@
                     }, "json");
                 });
 
+                //闈㈡澘椤垫彁浜わ細闅愯棌闈㈡澘锛堢櫧鍚嶅崟锛岄粦鍚嶅崟锛屼慨鏀瑰瘑鐮侊級
+                $("#blackForm, #whiteForm").ajaxForm({
+                    success: function (r) {
+                        mytek.alert(r.Message, r.OK, function () {
+                            $("#whiteDialog, #blackDialog").modal("hide");
+                        });
+                    }
+                });
+
+                //闈㈡澘椤垫彁浜わ細閲嶆柊鍔犺浇鍒楄〃
+                $("#clientForm, #updatePwdForm").ajaxForm({
+                    success: function (r) {
+                        mytek.alert(r.Message, r.OK, function () {
+                            r.OK && (window.location.reload());
+                        });
+                    }
+                });
+
+                //淇敼瀵嗙爜锛氭墦寮�鐣岄潰
+                $(document).on("click", ".action-modal-updatePwd", function () {
+                    //$("#updatePwdDialog .modal-title").text("淇敼瀹㈡埛璧勬枡");
+                    $("#updatePwdDialog input[name=action]").val("updatePwd");
+                    var id = $(this).data("id");
+
+                    $("#updatePwdDialog input[name='clientID']").val(id);
+                    $("#updatePwdDialog #newPwd").val("");
+
+                    $("#updatePwdDialog").modal("show");
+                    
+                });
+
+                //淇敼鍒嗛厤涓�т骇鍝侊細鏄剧ず瀹㈡埛瀵瑰簲鐨勫垎閰嶄釜鎬т骇鍝�
+                $(document).on("click", ".action-modal-updateProduct", function () {
+                    var clientId = $(this).data("id");
+                    $.get("GwClient.ashx", { action: "getPersonalityProduct", clientId: clientId }, function (result) {
+                        if (!result.OK) {
+                            mytek.alert(result.Message, result.OK);
+                        }
+                        else {
+                            $("#updateProductDialog input[name='clientID']").val(clientId);
+                            $("#updateProductDialog #_ProductId").prop("checked", false);
+                            $.each(result.Message, function (i) {
+                                $("#updateProductDialog #_ProductId[value='" + this + "']").prop("checked", true);
+                            });
+                        }
+                        $("#updateProductDialog").modal("show");
+                    }, "json");
+                });
+
+                //淇敼鍒嗛厤涓�т骇鍝侊細淇敼纭
+                $(document).on("click", ".action-updateProduct", function () {
+                    var productIdArray = [];
+
+                    $("#updateProductDialog #_ProductId").each(function () {
+                        if ($(this).is(":checked")) {
+                            productIdArray.push($(this).val());
+                        }
+                    });
+
+                    //var clientId = $("#updateProductDialog").data("id");
+                    var clientId = $("#updateProductDialog input[name='clientID']").val();
+                    $.ajax({
+                        url: "GwClient.ashx",
+                        type: "POST",
+                        data: { action: "updateProduct", clientId: clientId, productIdArray: $.toJSON(productIdArray) },
+                        success: function (result) {
+                            if (result.OK) {
+                                $("#updateProductDialog").modal("hide");
+                                loadPageList();
+                            } else {
+                                mytek.alert(result.Message, result.OK);
+                            }
+                        }
+                    });
+                });
+
+
+                //鍏呭��
+                $(document).on("click", ".action-modal-orderCreate", function () {
+                    var clientId = $(this).data("id");  //瀹㈡埛璐﹀彿
+                    //window.open("gwOrderCreate.aspx?spId=" + spID, 'gwOrderCreate');
+                    window.location.href = "gwOrderCreate.aspx?clientId=" + clientId;
+                });
+
+                //鍏呭�兼棩蹇�
+                $(document).on("click", ".action-modal-orderLog", function () {
+                    var clientId = $(this).data("id");
+                    window.location.href = "GwOrderList.aspx?clientId=" + clientId + "";
+                });
+
+                //鍚敤鎴栧仠鐢�
+                $(document).on("click", ".action-modal-updateStatus", function () {
+                    //data鐨勫睘鎬у弬鏁颁笉鑳藉惈鏈夊ぇ鍐欏瓧姣嶃��
+                    var clientId = $(this).data("id");
+                    var isEnable = $(this).data("status");
+                    var statusMsg = "";
+                    if (isEnable == 0) {
+                        statusMsg = "銆愬仠鐢ㄣ��";
+                    }
+                    else {
+                        statusMsg = "銆愬惎鐢ㄣ��";
+                    }
+                    mytek.confirm("鏄惁闇�瑕�" + statusMsg + "璇ヤ俊鎭紵", "纭鏇存柊淇℃伅鐘舵�侊紝璇疯皑鎱庢搷浣滐紒", function (b) {
+                        if (b) {
+                            $.post("gwclient.ashx", { "action": "updateStatus", clientId: clientId, isEnable: isEnable }, function (r) {
+                                mytek.alert(r.Message, r.OK, function () {
+                                    loadPageList();
+                                });
+                            });
+                        }
+                    });
+                });
+
+                //鍒犻櫎
                 $(document).on("click", ".action-delete", function () {
                     var id = $(this).data("id");
                     mytek.confirm("鏄惁闇�瑕佸垹闄よ瀹㈡埛锛�", "瀹㈡埛鍒犻櫎鍚庡皢鏃犳硶鎭㈠锛岃璋ㄦ厧鎿嶄綔锛�", function (b) {
@@ -170,6 +332,7 @@
                     });
                 });
 
+                /**
                 //閲嶇疆瀵嗙爜
                 $(document).on("click", ".action-modal-resetPwd", function () {
                     var id = $(this).data("id");
@@ -183,22 +346,8 @@
                         }
                     });
                 });
+                **/
 
-                $("#blackForm,#whiteForm").ajaxForm({
-                    success: function (r) {
-                        mytek.alert(r.Message, r.OK, function () {
-                            $("#whiteDialog,#blackDialog").modal("hide");
-                        });
-                    }
-                });
-
-                $("#clientForm").ajaxForm({
-                    success: function (r) {
-                        mytek.alert(r.Message, r.OK, function () {
-                            r.OK && (window.location.reload());
-                        });
-                    }
-                });
             })
 
             //鍏ㄩ��
@@ -206,7 +355,7 @@
                 $("input[name='checkbox']").prop("checked", $(this).is(":checked"));
             });
 
-            //鎵归噺鍒嗛厤涓�т骇鍝�
+            //鎵归噺鍒嗛厤涓�т骇鍝�:鎵撳紑鐣岄潰
             $(document).on("click", ".action-modal-setProduct", function () {
                 var idArray = [];
 
@@ -256,9 +405,81 @@
             });
 
 
+            //娣诲姞瀹㈡埛锛氱敓鎴愬瘑鐮�
+            $(document).on("click", ".action-generate-password", function () {
+                $("#password").val(randomString(8));
+            });
+
+            //娣诲姞瀹㈡埛锛氬鍒跺瘑鐮�
+            $(document).on("click", ".action-copyPwd", function () {
+                var value = $("#password").val();
+                // for ie
+                if (window.clipboardData) {
+                    window.clipboardData.clearData();
+                    window.clipboardData.setData('text', value);
+                }
+                // for modern browser
+                else if (document.execCommand) {
+                    var element = document.createElement('SPAN');
+                    element.textContent = value;
+                    document.body.appendChild(element);
+                    if (document.selection) {
+                        var range = document.body.createTextRange();
+                        range.moveToElementText(element);
+                        range.select();
+                    } else if (window.getSelection) {
+                        var range = document.createRange();
+                        range.selectNode(element);
+                        window.getSelection().removeAllRanges();
+                        window.getSelection().addRange(range);
+                    }
+                    document.execCommand('copy');
+                    element.remove ? element.remove() : element.removeNode(true);
+                }
+                mytek.alert("澶嶅埗鎴愬姛锛�", false);
+
+            });
+
+            //淇敼瀵嗙爜锛氱敓鎴愬瘑鐮�
+            $(document).on("click", ".action-generate-newPwd", function () {
+                $("#newPwd").val(randomString(8));
+            });
+
+            //淇敼瀵嗙爜锛氬鍒跺瘑鐮�
+            $(document).on("click", ".action-copyNewPwd", function () {
+                var value = $("#newPwd").val();
+                // for ie
+                if (window.clipboardData) {
+                    window.clipboardData.clearData();
+                    window.clipboardData.setData('text', value);
+                }
+                // for modern browser
+                else if (document.execCommand) {
+                    var element = document.createElement('SPAN');
+                    element.textContent = value;
+                    document.body.appendChild(element);
+                    if (document.selection) {
+                        var range = document.body.createTextRange();
+                        range.moveToElementText(element);
+                        range.select();
+                    } else if (window.getSelection) {
+                        var range = document.createRange();
+                        range.selectNode(element);
+                        window.getSelection().removeAllRanges();
+                        window.getSelection().addRange(range);
+                    }
+                    document.execCommand('copy');
+                    element.remove ? element.remove() : element.removeNode(true);
+                }
+                mytek.alert("澶嶅埗鎴愬姛锛�", false);
+
+            });
+
 
         });
     </script>
+        
+
 </asp:Content>
 <asp:Content ID="Content2" ContentPlaceHolderID="title" runat="Server">瀹㈡埛淇℃伅</asp:Content>
 <asp:Content ID="Content3" ContentPlaceHolderID="content" runat="Server">
@@ -323,7 +544,47 @@
         </form>
     </div>
 
-    <!--鍒涘缓瀹㈡埛璐︽埛闈㈡澘 -->
+    <!--閲嶇疆瀵嗙爜鎴栦慨鏀瑰瘑鐮� -->
+    <div class="modal inmodal fade" id="updatePwdDialog" tabindex="-1" role="dialog" aria-hidden="true">
+        <form name="updatePwdForm" method="post" action="gwclient.ashx?action=updatePwd" id="updatePwdForm"
+            class="form-horizontal">
+            <div class="modal-dialog modal-lg">
+                <div class="modal-content ">
+                    <div class="modal-header">
+                        <button type="button" class="close" data-dismiss="modal">
+                            <span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
+                        <h4 class="modal-title">瀹㈡埛淇℃伅瀵嗙爜淇敼
+                        </h4>
+                        璇峰厛鎵ц銆愮敓鎴愬瘑鐮併�戝悗锛屽啀鎵ц銆愬鍒跺瘑鐮併�戙��
+                    </div>
+                    <div class="modal-body">
+                        <input type="hidden" value="" name="clientID" />
+                        <div class="form-group">
+                            <label class="control-label  col-sm-2">
+                                鐧诲綍瀵嗙爜 <span style="color:red">*</span>
+                            </label>
+                            <div class="col-sm-4">
+                                <input type="password" name="newPwd" id="newPwd" value="" class="form-control" />
+                            </div>
+                            <div class="col-sm-6">
+                                <a class="btn btn-xs btn-primary action-generate-newPwd ">鐢熸垚瀵嗙爜</a>
+                                <a class="btn btn-xs btn-success action-copyNewPwd " >澶嶅埗瀵嗙爜</a>
+                            </div>
+                        </div>
+                    </div>
+                    <div class="modal-footer">
+                        <button class="btn btn-warning" data-dismiss="modal" aria-hidden="true">
+                            鍙栨秷</button>&nbsp;&nbsp;
+                    <button class="btn btn-primary action-save">
+                        淇濆瓨</button>
+                    </div>
+                </div>
+            </div>
+        </form>
+    </div>
+
+
+    <!--鍒涘缓瀹㈡埛淇℃伅闈㈡澘 -->
     <div class="modal inmodal fade" id="clientDialog" tabindex="-1" role="dialog" aria-hidden="true">
         <form name="clientForm" method="post" action="gwclient.ashx" id="clientForm" class="form-horizontal">
             <div class="modal-dialog modal-lg">
@@ -358,16 +619,16 @@
                         </div>
 
 
-                        <div class="form-group">
+                        <div class="form-group pwdCss">
                             <label class="control-label  col-sm-2">
                                 鐧诲綍瀵嗙爜 <span style="color:red">*</span>
                             </label>
                             <div class="col-sm-4">
-                                <input type="text" name="password" id="password" value="123456" class="form-control" />
+                                <input type="password" name="password" id="password" value="123456" class="form-control" />
                             </div>
                             <div class="col-sm-6">
                                 <a class="btn btn-xs btn-primary action-generate-password ">鐢熸垚瀵嗙爜</a>
-                                <a class="btn btn-xs btn-success action-copyPwd ">澶嶅埗瀵嗙爜</a>
+                                <a class="btn btn-xs btn-success action-copyPwd " >澶嶅埗瀵嗙爜</a>
                             </div>
                         </div>
                         <div class="form-group">
@@ -505,6 +766,99 @@
                             -->
                         <div class="form-group">
                             <label class="control-label  col-sm-2">
+                                鏄惁鍚敤鐧藉悕鍗�
+                            </label>
+                            <div class="col-sm-4">
+                                <input type="radio" class="icheck-me" name="isEnableWhite" value="0" /><label>绂佺敤</label>
+                                <input type="radio" class="icheck-me" name="isEnableWhite" value="1" /><label>鍚敤</label>
+                            </div>
+                        </div>
+                        <div class="form-group">
+                            <label class="control-label  col-sm-2">
+                                鏄惁鍚敤榛戝悕鍗�
+                            </label>
+                            <div class="col-sm-4">
+                                <input type="radio" class="icheck-me" name="isEnableBlack" value="0" checked="checked" /><label>绂佺敤</label>
+                                <input type="radio" class="icheck-me" name="isEnableBlack" value="1" /><label>鍚敤</label>
+                            </div>
+                        </div>
+                        <div class="form-group">
+                            <label class="control-label  col-sm-2">
+                                鏄惁寮傚湴鐧诲綍閫氱煡
+                            </label>
+                            <div class="col-sm-4">
+                                <input type="radio" class="icheck-me" name="isRemoteLoginNotice" value="0" checked="checked" /><label>绂佺敤</label>
+                                <input type="radio" class="icheck-me" name="isRemoteLoginNotice" value="1" /><label>鍚敤</label>
+                            </div>
+                        </div>
+                        <div class="form-group">
+                            <label class="control-label  col-sm-2">
+                                鏄惁鍚敤鎵嬫満楠岃瘉鐮�
+                            </label>
+                            <div class="col-sm-4">
+                                <input type="radio" class="icheck-me" name="isMobileCaptcha" value="0" checked="checked" /><label>绂佺敤</label>
+                                <input type="radio" class="icheck-me" name="isMobileCaptcha" value="1" /><label>鍚敤</label>
+                            </div>
+                        </div>
+                        <div class="form-group">
+                            <label class="control-label  col-sm-2">
+                                鏄惁闅愯棌瀹㈡埛绔墜鏈哄彿
+                            </label>
+                            <div class="col-sm-4">
+                                <input type="radio" class="icheck-me" name="isHideMobile" value="0" checked="checked" /><label>绂佺敤</label>
+                                <input type="radio" class="icheck-me" name="isHideMobile" value="1" /><label>鍚敤</label>
+                            </div>
+                        </div>
+                        <div class="form-group">
+                            <label class="control-label  col-sm-2">
+                                鏄惁鏄剧ず鐘舵�佹帴鍙�
+                            </label>
+                            <div class="col-sm-8">
+                                <input type="radio" class="icheck-me" name="isDisplayStatus" value="0" checked="checked" /><label>涓嶆樉绀�</label>
+                                <input type="radio" class="icheck-me" name="isDisplayStatus" value="1" /><label>鍙樉绀烘彁浜ゅけ璐ヤ负鍙戦�佸け璐ョ姸鎬�</label>
+                                <input type="radio" class="icheck-me" name="isDisplayStatus" value="2" /><label>鏄剧ず鍏ㄩ儴鐘舵�佺姸鎬�</label>
+                            </div>
+                        </div>
+                        <div class="form-group">
+                            <label class="control-label  col-sm-2">
+                                鏄惁鍚敤鐧诲綍IP闄愬埗
+                            </label>
+                            <div class="col-sm-4">
+                                <input type="radio" class="icheck-me" name="isLoginIpRestrict" value="0" checked="checked" /><label>绂佺敤</label>
+                                <input type="radio" class="icheck-me" name="isLoginIpRestrict" value="1" /><label>鍚敤</label>
+                            </div>
+                        </div>
+                        <div class="form-group">
+                            <label class="control-label  col-sm-2">
+                                鐧诲綍IP鍏佽闆嗗悎
+                            </label>
+                            <div class="col-sm-4">
+                                <textarea class="form-control" name="isLoginIpAllowGather" id="isLoginIpAllowGather" rows="4" ></textarea>
+                                <!--<span class="help-block m-b-none">閰嶅悎鏄惁鍚敤鐧诲綍IP闄愬埗涓�璧蜂娇鐢紝澶氫釜闄愬埗IP鏃讹紝鎸夊崐瑙掗�楀彿","鍒嗛殧銆傚彲浣跨敤IP娈碉紝濡傦細202.203.1.*銆�</span>-->
+                                <span class="help-block m-b-none">閰嶅悎鏄惁鍚敤鐧诲綍IP闄愬埗涓�璧蜂娇鐢紝澶氫釜闄愬埗IP鏃讹紝姣忎竴琛屼负1涓狪P銆傚彲浣跨敤IP娈碉紝濡傦細202.203.1.*銆�</span>
+                            </div>
+                        </div>
+                        <div class="form-group">
+                            <label class="control-label  col-sm-2">
+                                鏄惁鍚敤鐧诲綍鍦板尯锛堝煄甯傦級闄愬埗
+                            </label>
+                            <div class="col-sm-4">
+                                <input type="radio" class="icheck-me" name="isLoginCityRestrict" value="0" checked="checked" /><label>绂佺敤</label>
+                                <input type="radio" class="icheck-me" name="isLoginCityRestrict" value="1" /><label>鍚敤</label>
+                            </div>
+                        </div>
+                        <div class="form-group">
+                            <label class="control-label  col-sm-2">
+                                鐧诲綍鍦板尯锛堝煄甯傦級鍏佽闆嗗悎
+                            </label>
+                            <div class="col-sm-4">
+                                <textarea class="form-control" name="isLoginCityAllowGather" id="isLoginCityAllowGather" rows="4" ></textarea>
+                                <!--<span class="help-block m-b-none">閰嶅悎鏄惁鍚敤鐧诲綍鍩庡競闄愬埗涓�璧蜂娇鐢紝澶氫釜闄愬埗鍦板尯鏃讹紝鎸夊崐瑙掗�楀彿","鍒嗛殧銆� </span>-->
+                                <span class="help-block m-b-none">閰嶅悎鏄惁鍚敤鐧诲綍鍩庡競闄愬埗涓�璧蜂娇鐢紝澶氫釜闄愬埗鍦板尯鏃讹紝姣忎竴琛屼负1涓湴鍖猴紙鍩庡競锛夈�� </span>
+                            </div>
+                        </div>
+                        <div class="form-group">
+                            <label class="control-label  col-sm-2">
                                 澶囨敞
                             </label>
                             <div class="col-sm-10">
@@ -523,6 +877,7 @@
         </form>
     </div>
 
+    <!-- 鏉′欢鏌ヨ -->
     <form name="queryForm" method="post" id="queryForm" class="form-inline">
         <div class="form-group">
             <div class="input-group m-b">
@@ -566,7 +921,7 @@
         </div>
         <div class="form-group">
             <div class="input-group m-b">
-                <span class="input-group-addon">浣跨敤浜у搧</span>
+                <span class="input-group-addon">宸插垎閰嶆縺娲讳骇鍝�</span>
                     <select name="ProductId" id="ProductId" class="form-control">
                         <%=GetProductOptions("")%>
                     </select>
@@ -575,14 +930,17 @@
         <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" />&nbsp
-            <input class="btn btn-danger action-modal-setProduct" value="鎵归噺鍒嗛厤涓�т骇鍝�" type="button" />
+                <input class="btn btn-success action-modal-create" value="鍒涘缓瀹㈡埛" type="button" />&nbsp   
             </div>
 
         </div>
     </form>
 
+    <!-- 鍒楄〃 -->
     <div class="table-responsive">
+        <% if(IsEnable==1) { %>
+        <input class="btn btn-danger action-modal-setProduct" value="鎵归噺鍒嗛厤涓�т骇鍝�" type="button" />            
+        <%} %>
         <table class="table table-striped table-bordered table-hover" id="gwclientTable">
             <thead>
                 <tr class="header">
@@ -603,10 +961,16 @@
 
                     <th>涓氬姟鍛�
                     </th>
+
+                    <th>宸插垎閰嶄釜鎬т骇鍝�(澶氫釜鎸夆��,鈥濆垎闅�)
+                    </th>
                     <!--
                     <th>璁よ瘉鐘舵��
                     </th>
                     -->
+
+                    <th>鐘舵��
+                    </th>
                     <th>鎿嶄綔
                     </th>
                 </tr>
@@ -619,16 +983,16 @@
     <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">
+                <div class="modal-header">                    
+                    <span class="title"><h3>鎵归噺鍒嗛厤涓�т骇鍝�</h3></span><a class="close" data-dismiss="modal" aria-hidden="true">脳</a> 
+                    <span class="text-muted">
                         鎵归噺鍒嗛厤涓�т骇鍝佸皢浼氭洿鏂版墍鏈夐�変腑鐨勮处鍙风殑瀹㈡埛锛�<br />
                         纭畾鍒嗛厤涓嶈兘鍙栨秷锛岃璋ㄦ厧鎿嶄綔锛�<br />
+                        </span>
                 </div>
                 <div class="modal-body">
                     <div class="form-group">
@@ -649,6 +1013,28 @@
                 </div>
             </div>
         </div>
+    </div>
+
+    <!-- 瀹㈡埛淇敼涓�т骇鍝� -->        
+    <div class="modal inmodal fade" id="updateProductDialog" tabindex="-1" role="dialog" aria-hidden="true">
+            <div class="modal-dialog">
+                <div class="modal-content animated bounceInRight">
+                    <input type="hidden" value="" name="clientID" />
+                    <div class="modal-header">
+                        <span class="title">璁剧疆瀹㈡埛涓�т骇鍝�</span><a class="close" data-dismiss="modal" aria-hidden="true">脳</a>
+                    </div>
+                    <div class="modal-body">                   
+                        <%=ClientProductAll() %>
+                    </div>
+                    <div class="modal-footer">
+                        <button class="btn-default btn" data-dismiss="modal" aria-hidden="true">
+                            鍙栨秷</button>&nbsp;&nbsp;
+                        <button class="btn btn-primary action-updateProduct">
+                            淇濆瓨</button>
+                    </div>
+                </div>
+            </div>
+        </div>
 
 </asp:Content>
 
diff --git a/web/web/GwClient.aspx.cs b/web/web/GwClient.aspx.cs
index b8a666f..2726e1c 100644
--- a/web/web/GwClient.aspx.cs
+++ b/web/web/GwClient.aspx.cs
@@ -14,7 +14,7 @@
 {
 
     protected List<SysUser> SysUserList;
-    protected List<GwProduct> GwProductList;
+    protected List<GwProduct> GwProductList;    
 
     string addressClasses = ConfigurationManager.AppSettings["addressClasses"];
 
@@ -42,6 +42,13 @@
             bean.IsDefault = -1;
             bean.IsEnable = -1;
             this.GwProductList = gwProductDao.getAllList(bean);
+        }
+    }
+    public int IsEnable
+    {
+        get
+        {
+            return this.AppContext.GetInt("IsEnable");
         }
     }
 
@@ -221,5 +228,47 @@
         return stringBuilder.ToString();
     }
 
+    //鎵�鏈変釜鎬т骇鍝�
+    protected string ClientProductAll()
+    {
+        using (GwProductDao gwProductDao = new GwProductDao())
+        {
+            GwProduct gwProduct = new GwProduct();
+            gwProduct.Classes = 1;  //0-浜у搧鍒嗙被锛�1-浜у搧
+            gwProduct.IsDefault = 0;    //榛樿鍊�0銆�0-涓�у寲锛�1-绯荤粺榛樿銆�
+            gwProduct.IsEnable = 1;    //0-鍋滅敤锛�1-鍚敤锛涢粯璁�1
+            List<GwProduct> list = gwProductDao.getAllList(gwProduct);
+
+            StringBuilder stringBuilder = new StringBuilder();
+            stringBuilder.Append("<table cellpadding='5'>");
+            if(list.Count>0)
+            {
+                for (int i = 0; i < list.Count; i++)
+                {
+                    GwProduct bean = (GwProduct)list[i];
+
+                    //琛屽紑濮嬬
+                    if (i%5 == 0)
+                    {
+                        stringBuilder.Append("<tr>");
+                    }
+
+                    //琛屽崟鍏冩牸
+                    stringBuilder.AppendFormat("<td><input  type=\"checkbox\" id=\"_ProductId\"  name=\"_ProductId\" value=\"{0}\" /><span  style='padding:5px;'>{1} </span>  \r\n         </td>", (object)bean.Id, (object)bean.Name);
+
+                    //琛岀粨鏉熺
+                    if (i % 5 == 4 || i == (list.Count - 1))
+                    {
+                        stringBuilder.Append("</tr>");
+                    }
+
+                }
+            }
+            stringBuilder.Append("</table>");
+
+            return stringBuilder.ToString();
+        }
+    }
+
 
 }
diff --git a/web/web/GwOrder.ashx b/web/web/GwOrder.ashx
index dbe8cc6..b1a5ef4 100644
--- a/web/web/GwOrder.ashx
+++ b/web/web/GwOrder.ashx
@@ -55,6 +55,8 @@
                 return this.Cancel(context);      //鍙栨秷    
             case "audit":
                 return this.Audit(context);      //璁㈠崟瀹℃牳
+            case "getOrderBySpId":
+                return this.GetOrderBySpId(context);      //璁㈠崟瀹℃牳
 
             default:
                 throw new Exception("Invalid Action=" + @string);
@@ -70,7 +72,7 @@
         string compay = context.GetString("compay");
         int flag = context.GetInt("flag");
         DateTime startDate = context.GetDateTime("startDate");
-        DateTime endDate = context.GetDateTime("endDate");
+        DateTime endDate = context.GetDateTime("endDate")==DateTime.Parse("0001-01-01 00:00:00")? DateTime.Now : context.GetDateTime("endDate");
 
         int recordCount = 0;
         int pageSize = context.GetInt("pageSize", 50);
@@ -79,66 +81,6 @@
         string permissionsSQL = new GwClientDao().GetClientPermissions(_userId, _userType, "GWC");
 
         List<GwOrder> list = _Dao.LoadInfoList(spId, clientId, compay, flag, startDate, endDate, pageSize, pageIndex, permissionsSQL, out recordCount);
-
-        string str1 = "";
-        if (list != null && list.Count > 0)
-        {
-
-            int num = 0;
-            foreach (GwOrder bean in list)
-            {
-                ++num;
-
-                str1 += "<tr><td>" + bean.OrderId + "</td>";
-                str1 = str1 + "<td>" + bean.SpId + "</td>";
-                str1 = str1 + "<td>" + bean.ClientId + "-" + bean.ClientName + "</td>";
-                str1 = str1 + "<td>" + ProductToName(bean.ProductId) + "</td>";
-                //str1 = str1 + "<td>" + bean.ComboId + "</td>";
-                str1 = str1 + "<td>" + bean.BasicNum + "</td>";
-                str1 = str1 + "<td>" + bean.GivingNum + "</td>";
-                str1 = str1 + string.Format("<td>{0}</td>", (object)(Convert.ToDecimal(bean.Price) / new Decimal(1000)));
-                str1 = str1 + "<td>" + bean.OrderNumTotal + "</td>";
-                str1 = str1 + string.Format("<td>{0}</td>", (object)(Convert.ToDecimal(bean.OrderAmountTotal) / new Decimal(1000)));
-                str1 = str1 + string.Format("<td>{0}</td>", (object)(Convert.ToDecimal(bean.PayAmount) / new Decimal(1000)));
-                str1 = str1 + "<td>" + bean.BeforeBalanceNum + "</td>";
-                str1 = str1 + "<td>" + bean.Creator + "</td>";
-                str1 = str1 + "<td>" + bean.CreateTime + "</td>";
-                str1 = str1 + "<td>" + StatusToName(bean.Status) + "</td>";
-                //str1 = str1 + "<td>" + bean.Remark + "</td>";
-
-                str1 += "<td  class=\"text-right\">";
-                str1 += string.Format("<a href=\"javascript:;\" data-orderid=\"{0}\" class=\"action-modal-detail btn  btn-success btn-xs\"><i class=\"fa fa-search\"></i>&nbsp;鏌ョ湅</a> ", (object) bean.OrderId);
-                str1 += "</td>";
-                str1 += "</tr>";
-            }
-        }
-        else
-            str1 += "<tr><td colspan=\"15\" style=\"padding-left:5px; text-align: center;\">鏆傛棤淇℃伅</td></tr>";
-
-        return new JsonPageResult(true,  new
-        {
-            Table = str1.ToString(),
-            TotalCount = recordCount
-        });
-    }
-
-    //鍔犺浇寰呭鏍歌鍗曪紙寰呭鏍搞�佸鏍镐腑锛�
-    private JsonPageResult ListAudit(PageContext<SysUser> context)
-    {
-        string spId = context.GetString("spId");
-        string clientId = context.GetString("clientId");
-        string clientName = context.GetString("clientName");
-        int flag = context.GetInt("flag");
-        DateTime startDate = context.GetDateTime("startDate");
-        DateTime endDate = context.GetDateTime("endDate");
-
-        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, permissionsSQL, out recordCount);
 
         string str1 = "";
         if (list != null && list.Count > 0)
@@ -162,6 +104,69 @@
                 str1 = str1 + string.Format("<td>{0}</td>", (object)(Convert.ToDecimal(bean.OrderAmountTotal) / new Decimal(1000)));
                 str1 = str1 + string.Format("<td>{0}</td>", (object)(Convert.ToDecimal(bean.PayAmount) / new Decimal(1000)));
                 str1 = str1 + "<td>" + bean.BeforeBalanceNum + "</td>";
+                str1 = str1 + "<td>" + bean.Auditor + "</td>";
+                str1 = str1 + "<td>" + bean.Creator + "</td>";
+                str1 = str1 + "<td>" + bean.CreateTime + "</td>";
+                str1 = str1 + "<td>" + StatusToName(bean.Status) + "</td>";
+                //str1 = str1 + "<td>" + bean.Remark + "</td>";
+
+                str1 += "<td  class=\"text-right\">";
+                str1 += string.Format("<a href=\"javascript:;\" data-orderid=\"{0}\" class=\"action-modal-detail btn  btn-success btn-xs\"><i class=\"fa fa-search\"></i>&nbsp;鏌ョ湅</a> ", (object) bean.OrderId);
+                str1 += "</td>";
+                str1 += "</tr>";
+            }
+        }
+        else
+            str1 += "<tr><td colspan=\"16\" style=\"padding-left:5px; text-align: center;\">鏆傛棤淇℃伅</td></tr>";
+
+        return new JsonPageResult(true,  new
+        {
+            Table = str1.ToString(),
+            TotalCount = recordCount
+        });
+    }
+
+    //鍔犺浇寰呭鏍歌鍗曪紙寰呭鏍搞�佸鏍镐腑锛�
+    private JsonPageResult ListAudit(PageContext<SysUser> context)
+    {
+        string spId = context.GetString("spId");
+        string clientId = context.GetString("clientId");
+        string company = context.GetString("company");
+        int flag = context.GetInt("flag");
+        DateTime startDate = context.GetDateTime("startDate");
+        DateTime endDate = context.GetDateTime("endDate")==DateTime.Parse("0001-01-01 00:00:00")? DateTime.Now : context.GetDateTime("endDate");
+
+        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, company, flag, startDate, endDate, pageSize, pageIndex, permissionsSQL, out recordCount);
+
+        string str1 = "";
+        if (list != null && list.Count > 0)
+        {
+
+            int num = 0;
+            foreach (GwOrder bean in list)
+            {
+                ++num;
+
+                //str1 += "<tr><td>" + bean.OrderId + "</td>";
+                str1 = str1 + "<tr><td>" + bean.SpId + "</td>";
+                str1 = str1 + "<td>" + bean.ClientId + "</td>";
+                str1 = str1 + "<td>" + bean.Company + "</td>";
+                str1 = str1 + "<td>" + ProductToName(bean.ProductId) + "</td>";
+                //str1 = str1 + "<td>" + bean.ComboId + "</td>";
+                str1 = str1 + "<td>" + bean.BasicNum + "</td>";
+                str1 = str1 + "<td>" + bean.GivingNum + "</td>";
+                str1 = str1 + string.Format("<td>{0}</td>", (object)(Convert.ToDecimal(bean.Price) / new Decimal(1000)));
+                str1 = str1 + "<td>" + bean.OrderNumTotal + "</td>";
+                str1 = str1 + string.Format("<td>{0}</td>", (object)(Convert.ToDecimal(bean.OrderAmountTotal) / new Decimal(1000)));
+                str1 = str1 + string.Format("<td>{0}</td>", (object)(Convert.ToDecimal(bean.PayAmount) / new Decimal(1000)));
+                str1 = str1 + "<td>" + bean.BeforeBalanceNum + "</td>";
+                str1 = str1 + "<td>" + bean.Auditor + "</td>";
                 str1 = str1 + "<td>" + bean.Creator + "</td>";
                 str1 = str1 + "<td>" + bean.CreateTime + "</td>";
                 str1 = str1 + "<td>" + StatusToName(bean.Status) + "</td>";
@@ -178,7 +183,7 @@
             }
         }
         else
-            str1 += "<tr><td colspan=\"15\" style=\"padding-left:5px; text-align: center;\">鏆傛棤淇℃伅</td></tr>";
+            str1 += "<tr><td colspan=\"16\" style=\"padding-left:5px; text-align: center;\">鏆傛棤淇℃伅</td></tr>";
 
         return new JsonPageResult(true,  new
         {
@@ -204,12 +209,12 @@
 
         string spId = context.GetString("spId");
         string clientId = context.GetString("clientId");
-        string clientName = context.GetString("clientName");
+        string company = context.GetString("company");
         int flag = context.GetInt("flag");
         //string startDate = context.GetString("startDate");
         //string endDate = context.GetString("endDate");
         DateTime startDate = context.GetDateTime("startDate");
-        DateTime endDate = context.GetDateTime("endDate");
+        DateTime endDate = context.GetDateTime("endDate")==DateTime.Parse("0001-01-01 00:00:00")? DateTime.Now : context.GetDateTime("endDate");
 
         int recordCount = 0;
         int pageSize = context.GetInt("pageSize", 50);
@@ -218,7 +223,7 @@
         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, permissionsSQL, out recordCount);
+        List<GwOrder> list = _Dao.LoadInfoList(spId, clientId, company, flag, startDate, endDate.AddDays(1.0), pageSize, pageIndex, permissionsSQL, out recordCount);
 
         string str1 = "";
         if (list != null && list.Count > 0)
@@ -230,7 +235,7 @@
                 ++num;
 
                 //str1 += "<tr><td>" + bean.OrderId + "</td>";
-                str1 = str1 + "<td>" + bean.SpId + "</td>";
+                str1 = str1 + "<tr><td>" + bean.SpId + "</td>";
                 str1 = str1 + "<td>" + bean.ClientId + "</td>";
                 str1 = str1 + "<td>" + bean.Company + "</td>";
                 str1 = str1 + "<td>" + ProductToName(bean.ProductId) + "</td>";
@@ -242,6 +247,7 @@
                 str1 = str1 + string.Format("<td>{0}</td>", (object)(Convert.ToDecimal(bean.OrderAmountTotal) / new Decimal(1000)));
                 str1 = str1 + string.Format("<td>{0}</td>", (object)(Convert.ToDecimal(bean.PayAmount) / new Decimal(1000)));
                 str1 = str1 + "<td>" + bean.BeforeBalanceNum + "</td>";
+                str1 = str1 + "<td>" + bean.Auditor + "</td>";
                 str1 = str1 + "<td>" + bean.Creator + "</td>";
                 str1 = str1 + "<td>" + bean.CreateTime + "</td>";
                 str1 = str1 + "<td>" + StatusToName(bean.Status) + "</td>";
@@ -258,7 +264,7 @@
             }
         }
         else
-            str1 += "<tr><td colspan=\"15\" style=\"padding-left:5px; text-align: center;\">鏆傛棤淇℃伅</td></tr>";
+            str1 += "<tr><td colspan=\"16\" style=\"padding-left:5px; text-align: center;\">鏆傛棤淇℃伅</td></tr>";
 
         return new JsonPageResult(true,  new
         {
@@ -318,6 +324,11 @@
         string remark = context.GetString("remark");
         int status = context.GetInt("status");  //0-瀹℃牳涓嶉�氳繃锛�1-瀹℃牳閫氳繃
         string auditReason = context.GetString("auditReason");
+
+        if (status == 0 && string.IsNullOrEmpty(auditReason) )
+        {
+            throw new ArgumentException("璇疯緭鍏ヤ笉閫氳繃鍘熷洜锛�");
+        }
         DateTime createTime = DateTime.Now;
         string creator = context.OperatorID;
 
@@ -562,11 +573,11 @@
 
         if (string.IsNullOrEmpty(clientId))
         {
-            throw new ArgumentException("瀹㈡埛涓嶈兘涓虹┖锛�");
+            throw new ArgumentException("瀹㈡埛璐﹀彿涓嶈兘涓虹┖锛�");
         }
         if (string.IsNullOrEmpty(spId))
         {
-            throw new ArgumentException("璐﹀彿涓嶈兘涓虹┖锛�");
+            throw new ArgumentException("鐭俊璐﹀彿涓嶈兘涓虹┖锛�");
         }
 
         if (basicNum<=0 && givingNum <= 0 && payAmount <=0)
@@ -745,11 +756,11 @@
 
         if (string.IsNullOrEmpty(clientId))
         {
-            throw new ArgumentException("瀹㈡埛涓嶈兘涓虹┖锛�");
+            throw new ArgumentException("瀹㈡埛璐﹀彿涓嶈兘涓虹┖锛�");
         }
         if (string.IsNullOrEmpty(spId))
         {
-            throw new ArgumentException("璐﹀彿涓嶈兘涓虹┖锛�");
+            throw new ArgumentException("鐭俊璐﹀彿涓嶈兘涓虹┖锛�");
         }
 
         if (basicNum<=0 && givingNum <= 0)
@@ -787,6 +798,54 @@
         return new JsonPageResult(true, this._Dao.Get(context.GetString("orderId")));
     }
 
+    //鏍规嵁瀹㈡埛API璐﹀彿鑾峰彇鍏呭�煎垵濮嬩俊鎭�
+    private JsonPageResult GetOrderBySpId(PageContext<SysUser> context)
+    {
+        string spId = context.GetString("spId");
+            
+            if (!string.IsNullOrEmpty(spId))
+        {
+            GwSp  gwSp = new GwSpDao().Get(spId);
+            if(gwSp==null)
+            {
+                throw new ArgumentException("璐﹀彿涓嶅瓨鍦紒");
+
+            }
+            else if (gwSp.Status==0)
+            {
+                throw new ArgumentException("璐﹀彿鐘舵�佸凡鍋滅敤锛�");
+
+            }
+
+
+            GwClient gwClient = new GwClient();
+            using (GwClientDao gwClientDao = new GwClientDao())
+            {
+                gwClient = gwClientDao.Get(gwSp.ClientID);
+            }
+
+
+            GwOrder gwOrder = new GwOrder();
+                gwOrder.SpId = gwSp.SpID;
+                gwOrder.ClientId = gwSp.ClientID;
+                gwOrder.ProductId = gwSp.ProductId;
+                gwOrder.Price = gwSp.Price;
+                gwOrder.BasicNum = gwSp.BasicNum;  //鍩烘湰鏉℃暟
+                gwOrder.GivingNum = gwSp.GivingNum;
+                
+                gwOrder.Balance = long.Parse(gwClient.Balance.ToString() );    //浣欓
+                
+            return new JsonPageResult(true, gwOrder);
+        }
+        else
+        {
+             throw new ArgumentException("璇烽�夋嫨鐭俊璐﹀彿锛�");
+
+        }
+
+
+    }
+
     //鑾峰彇閫氶亾鍒楄〃
     private List<GwOp> OpList
     {
diff --git a/web/web/GwOrderAudit.aspx b/web/web/GwOrderAudit.aspx
index 3af525f..55cf577 100644
--- a/web/web/GwOrderAudit.aspx
+++ b/web/web/GwOrderAudit.aspx
@@ -61,6 +61,8 @@
 
                 $("#orderDialog #auditInfo-1").css("display", "none");
 
+                $(".auditInfo-color").css("color", "");
+
                 $("#orderDialog #auditPass").css("display", "none");
                 $("#orderDialog #auditNoPass").css("display", "none");
 
@@ -96,6 +98,8 @@
 
                 $("#orderDialog #auditReason").val(r.Message.AuditReason);
                 $("#orderDialog #auditInfo-1").css("display", "");
+                
+                $(".auditInfo-color").css("color", "red");  //鍙~椤�
 
                 $("#orderDialog #auditPass").css("display", "");
                 $("#orderDialog #auditNoPass").css("display", "");
@@ -142,7 +146,7 @@
             var payAmount = $("#payAmount").val();            
             var price = $("#price").val();
             var auditReason = $("#auditReason").val();
-            mytek.confirm("鏄惁纭畾瀹℃牳閫氳繃璇ヤ俊鎭紵", "鏁版嵁鏇存柊鍚庡皢鏃犳硶鎭㈠锛岃璋ㄦ厧鎿嶄綔锛�", function (b) {
+            mytek.confirm("鏄惁纭畾銆愬鏍搁�氳繃銆戣淇℃伅锛�", "鏁版嵁鏇存柊鍚庡皢鏃犳硶鎭㈠锛岃璋ㄦ厧鎿嶄綔锛�", function (b) {
                 if (b) {
                     $.post("gwOrder.ashx", { "action": "audit", status: 1, spId: spId, orderId: orderId, basicNum: basicNum, givingNum: givingNum, payAmount: payAmount, price: price, auditReason: auditReason }, function (result) {
                         mytek.alert(result.Message, result.OK, function () {
@@ -163,7 +167,7 @@
             var payAmount = $("#payAmount").val();
             var price = $("#price").val();
             var auditReason = $("#auditReason").val();
-            mytek.confirm("鏄惁纭畾瀹℃牳涓嶉�氳繃璇ヤ俊鎭紵", "鏁版嵁鏇存柊鍚庡皢鏃犳硶鎭㈠锛岃璋ㄦ厧鎿嶄綔锛�", function (b) {
+            mytek.confirm("鏄惁纭畾銆愬鏍镐笉閫氳繃銆戣淇℃伅锛�", "鏁版嵁鏇存柊鍚庡皢鏃犳硶鎭㈠锛岃璋ㄦ厧鎿嶄綔锛�", function (b) {
                 if (b) {
                     $.post("gwOrder.ashx", { "action": "audit", status: 0, spId: spId, orderId: orderId, basicNum: basicNum, givingNum: givingNum, payAmount: payAmount, price: price, auditReason: auditReason }, function (result) {
                         mytek.alert(result.Message, result.OK, function () {
@@ -199,7 +203,7 @@
         <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>
@@ -211,7 +215,7 @@
             </div>
             <div class="form-group">
                 <div class="input-group m-b">
-                    <span class="input-group-addon">SP璐﹀彿</span>
+                    <span class="input-group-addon">鐭俊璐﹀彿</span>
                     <input type="text" name="SpId" id="SpId" class="form-control col-md-2" />
                 </div>
             </div>
@@ -228,7 +232,7 @@
                 </div>
             </div>
             <div class="form-group">
-                <div class="input-group">
+                <div class="input-group  m-b">
                     <input type="button" value="鏌ヨ" class="btn btn-primary action-btn-GwOrderQuery" />
                 </div>
             </div>
@@ -264,6 +268,8 @@
                     <th>鍏呭�奸噾棰濓紙鍏冿級
                     </th>
                     <th>鍏呭�煎墠璐﹀彿浣欓锛堟潯锛�
+                    </th>
+                    <th>瀹℃牳浜�(澶氱骇鎸夆��,鈥濆垎闅�)
                     </th>
                     <th>鍒涘缓浜�
                     </th>
@@ -338,7 +344,7 @@
                         </div>
                              --%>
                         <div class="form-group">
-                            <label class="col-sm-2 control-label">
+                            <label class="col-sm-2 control-label auditInfo-color">
                                 璁㈠崟鍩烘湰鏉℃暟</label>
                             <div class="col-sm-4">
                                 <div class="input-group">
@@ -349,7 +355,7 @@
                             </div>
                         </div>
                         <div class="form-group">
-                            <label class="col-sm-2 control-label">
+                            <label class="col-sm-2 control-label auditInfo-color">
                                 璁㈠崟璧犻�佹潯鏁�</label>
                             <div class="col-sm-4">
                                 <div class="input-group">
@@ -393,7 +399,7 @@
                             </div>
                         </div>
                         <div class="form-group">
-                            <label class="col-sm-2 control-label">
+                            <label class="col-sm-2 control-label auditInfo-color">
                                 鍏呭�奸噾棰�</label>
                             <div class="col-sm-4">
                                 <div class="input-group">
@@ -450,7 +456,7 @@
                             </div>
                         </div>
                         <div class="form-group" id="auditInfo-1">
-                            <label class="col-sm-2 control-label">
+                            <label class="col-sm-2 control-label auditInfo-color">
                                 涓嶉�氳繃鍘熷洜</label>
                             <div class="col-sm-10 input-group m-b">
                                 <input type="text" class="form-control" name="auditReason" id="auditReason" value="" />
diff --git a/web/web/GwOrderAudit.aspx.cs b/web/web/GwOrderAudit.aspx.cs
index f2ac1cf..85d8bb5 100644
--- a/web/web/GwOrderAudit.aspx.cs
+++ b/web/web/GwOrderAudit.aspx.cs
@@ -58,7 +58,8 @@
         {
             DateTime result;
             if (!DateTime.TryParse(this.Request["EndTime"], out result))
-                return DateTime.Now.Date.AddDays(1.0);
+                //return DateTime.Now.Date.AddDays(1.0);
+                return DateTime.Now.Date;
             return result;
         }
     }
@@ -126,9 +127,9 @@
             }
 
             if (productId.Equals(bean.Id) )
-                stringBuilder.AppendFormat("<option value=\"{0}\" selected>{0}-{1}</option>", (object)bean.Id, (object)bean.Name);
+                stringBuilder.AppendFormat("<option value=\"{0}\" selected>{1}</option>", (object)bean.Id, (object)bean.Name);
             else
-                stringBuilder.AppendFormat("<option value=\"{0}\">{0}-{1}</option>", (object)bean.Id, (object)bean.Name);
+                stringBuilder.AppendFormat("<option value=\"{0}\">{1}</option>", (object)bean.Id, (object)bean.Name);
         }
         return stringBuilder.ToString();
     }
@@ -143,9 +144,9 @@
         foreach (GwProduct bean in this.GwProductList)
         {
             if (productId.Equals(bean.Id))
-                stringBuilder.AppendFormat("<option value=\"{0}\" selected>{0}-{1}</option>", (object)bean.Id, (object)bean.Name);
+                stringBuilder.AppendFormat("<option value=\"{0}\" selected>{1}</option>", (object)bean.Id, (object)bean.Name);
             else
-                stringBuilder.AppendFormat("<option value=\"{0}\">{0}-{1}</option>", (object)bean.Id, (object)bean.Name);
+                stringBuilder.AppendFormat("<option value=\"{0}\">{1}</option>", (object)bean.Id, (object)bean.Name);
         }
         return stringBuilder.ToString();
     }
@@ -160,9 +161,9 @@
         foreach (GwClient bean in this.GwClientList)
         {
             if (clientId.Equals(bean.ClientID))
-                stringBuilder.AppendFormat("<option value=\"{0}\" selected>{0}-{1}</option>", (object)bean.ClientID, (object)bean.ClientName);
+                stringBuilder.AppendFormat("<option value=\"{0}\" selected>{1}</option>", (object)bean.ClientID, (object)bean.Company);
             else
-                stringBuilder.AppendFormat("<option value=\"{0}\">{0}-{1}</option>", (object)bean.ClientID, (object)bean.ClientName);
+                stringBuilder.AppendFormat("<option value=\"{0}\">{1}</option>", (object)bean.ClientID, (object)bean.Company);
         }
         return stringBuilder.ToString();
     }
diff --git a/web/web/GwOrderComplete.aspx b/web/web/GwOrderComplete.aspx
index 2ff3163..1eea045 100644
--- a/web/web/GwOrderComplete.aspx
+++ b/web/web/GwOrderComplete.aspx
@@ -93,7 +93,7 @@
         <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>
@@ -122,7 +122,7 @@
                 </div>
             </div>
             <div class="form-group">
-                <div class="input-group">
+                <div class="input-group  m-b">
                     <input type="button" value="鏌ヨ" class="btn btn-primary action-btn-GwOrderQuery" />
                 </div>
             </div>
@@ -159,6 +159,8 @@
                     </th>
                     <th>鍏呭�煎墠璐﹀彿浣欓锛堟潯锛�
                     </th>
+                    <th>瀹℃牳浜�(澶氱骇鎸夆��,鈥濆垎闅�)
+                    </th>
                     <th>鍒涘缓浜�
                     </th>
                     <th>鍒涘缓鏃堕棿
diff --git a/web/web/GwOrderComplete.aspx.cs b/web/web/GwOrderComplete.aspx.cs
index 2320cb3..efa5343 100644
--- a/web/web/GwOrderComplete.aspx.cs
+++ b/web/web/GwOrderComplete.aspx.cs
@@ -60,7 +60,8 @@
         {
             DateTime result;
             if (!DateTime.TryParse(this.Request["EndTime"], out result))
-                return DateTime.Now.Date.AddDays(1.0);
+                //return DateTime.Now.Date.AddDays(1.0);
+                return DateTime.Now.Date;
             return result;
         }
     }
@@ -128,9 +129,9 @@
             }
 
             if (productId.Equals(bean.Id) )
-                stringBuilder.AppendFormat("<option value=\"{0}\" selected>{0}-{1}</option>", (object)bean.Id, (object)bean.Name);
+                stringBuilder.AppendFormat("<option value=\"{0}\" selected>{1}</option>", (object)bean.Id, (object)bean.Name);
             else
-                stringBuilder.AppendFormat("<option value=\"{0}\">{0}-{1}</option>", (object)bean.Id, (object)bean.Name);
+                stringBuilder.AppendFormat("<option value=\"{0}\">{1}</option>", (object)bean.Id, (object)bean.Name);
         }
         return stringBuilder.ToString();
     }
@@ -151,9 +152,9 @@
             }
 
             if (productId.Equals(bean.Id))
-                stringBuilder.AppendFormat("<option value=\"{0}\" selected>{0}-{1}</option>", (object)bean.Id, (object)bean.Name);
+                stringBuilder.AppendFormat("<option value=\"{0}\" selected>{1}</option>", (object)bean.Id, (object)bean.Name);
             else
-                stringBuilder.AppendFormat("<option value=\"{0}\">{0}-{1}</option>", (object)bean.Id, (object)bean.Name);
+                stringBuilder.AppendFormat("<option value=\"{0}\">{1}</option>", (object)bean.Id, (object)bean.Name);
         }
         return stringBuilder.ToString();
     }
@@ -168,9 +169,9 @@
         foreach (GwClient bean in this.GwClientList)
         {
             if (clientId.Equals(bean.ClientID))
-                stringBuilder.AppendFormat("<option value=\"{0}\" selected>{0}-{1}</option>", (object)bean.ClientID, (object)bean.ClientName);
+                stringBuilder.AppendFormat("<option value=\"{0}\" selected>{1}</option>", (object)bean.ClientID, (object)bean.Company);
             else
-                stringBuilder.AppendFormat("<option value=\"{0}\">{0}-{1}</option>", (object)bean.ClientID, (object)bean.ClientName);
+                stringBuilder.AppendFormat("<option value=\"{0}\">{1}</option>", (object)bean.ClientID, (object)bean.Company);
         }
         return stringBuilder.ToString();
     }
diff --git a/web/web/GwOrderCreate.aspx b/web/web/GwOrderCreate.aspx
index e4fe91d..7cb0dd4 100644
--- a/web/web/GwOrderCreate.aspx
+++ b/web/web/GwOrderCreate.aspx
@@ -18,14 +18,7 @@
                 <div class="modal-body">
                     <div class="form-group">
                         <label class="col-sm-2 control-label">
-                            璐﹀彿ID</label>
-                        <div class="col-sm-6 ">
-                            <input type="text" class="form-control" name="spId" id="spId" value="<%=GwOrder.SpId %>" readonly="readonly"/>
-                        </div>
-                    </div>
-                    <div class="form-group">
-                        <label class="col-sm-2 control-label">
-                            瀹㈡埛ID</label>
+                            瀹㈡埛璐﹀彿</label>
                         <div class="col-sm-6 ">
                             <select name="clientId" id="clientId" class="form-control" disabled="disabled">
                                 <%=GetClientOptions(GwOrder.ClientId)%>
@@ -34,7 +27,22 @@
                     </div>
                     <div class="form-group">
                         <label class="col-sm-2 control-label">
-                            浜у搧ID</label>
+                            鐭俊璐﹀彿</label>
+                        <div class="col-sm-6 ">
+                            <%if (_controlFlag == 0)
+                                { %>
+                                <select name="spId" id="spId" class="form-control" onchange="getGwSp(this);" >
+                                    <%=GetSpOptions()%>
+                                </select>
+                            <%}
+                                else { %>
+                            <input type="text" class="form-control" name="spId" id="spId" value="<%=GwOrder.SpId %>" readonly="readonly"/>
+                            <%} %>
+                        </div>
+                    </div>
+                    <div class="form-group">
+                        <label class="col-sm-2 control-label">
+                            浜у搧鍚嶇О</label>
                         <div class="col-sm-6 ">
                             <select name="productId" id="productId" class="form-control" disabled="disabled">
                                 <%=GetProductOptions(GwOrder.ProductId)%>
@@ -46,7 +54,7 @@
                             鍩烘湰鏉℃暟浣欓</label>
                         <div class="col-sm-6">
                             <div class="input-group">
-                            <input type="text" class="form-control" value="<%=GwOrder.BasicNum %>" 
+                            <input type="text" class="form-control" name="_basicNum" id="_basicNum" value="<%=GwOrder.BasicNum %>" 
                                 onkeyup="value=value.replace(/[^\d\.]/g,'')" onpaste="value=value.replace(/[^\d\.]/g,'')"
                                 oncontextmenu="return false" readonly="readonly" /><span class="input-group-addon">鏉� </span>
                             </div>
@@ -57,7 +65,7 @@
                             璧犻�佹潯鏁颁綑棰�</label>
                         <div class="col-sm-6">
                             <div class="input-group">
-                            <input type="text" class="form-control" value="<%=GwOrder.GivingNum %>" 
+                            <input type="text" class="form-control" name="_givingNum" id="_givingNum" value="<%=GwOrder.GivingNum %>" 
                                 onkeyup="value=value.replace(/[^\d\.]/g,'')" onpaste="value=value.replace(/[^\d\.]/g,'')"
                                 oncontextmenu="return false" readonly="readonly" /><span class="input-group-addon">鏉� </span>
                             </div>
@@ -79,7 +87,7 @@
                             瀹㈡埛浣欓</label>
                         <div class="col-sm-6">
                             <div class="input-group">
-                                <input type="text" class="form-control" value="<%=(double)Balance/1000 %>" 
+                                <input type="text" class="form-control" name="balance" id="balance"  value="<%=(double)GwOrder.Balance/1000 %>" 
                                     onkeyup="value=value.replace(/[^\d\.]/g,'')" onpaste="value=value.replace(/[^\d\.]/g,'')"
                                     oncontextmenu="return false" readonly="readonly" /><span class="input-group-addon">鍏� </span>
                             </div>
@@ -128,7 +136,7 @@
                 </div>
                 <div class="modal-footer">
                     <a class="btn btn-primary action-save" href="javascript:;">淇濆瓨</a> 
-                    <a class="btn btn-default  action-back" href="javascript:;" onclick="return window.location = 'GwSp.aspx'">杩斿洖</a>
+                    <a class="btn btn-default  action-back" href="javascript:;" onclick="return window.location = '<%=backUrl %>'">杩斿洖</a>
                 </div>
             </div>
         </div>
@@ -172,6 +180,26 @@
 
         //}
 
+
+        function getGwSp(obj) {
+            if (obj.value != "") {
+                $.get("gwOrder.ashx", { "action": "getOrderBySpId", spId: obj.value }, function (r) {
+
+                    //$("#orderId").val(r.Message.OrderId).attr("readonly", "readonly");
+                    $("#clientId").val(r.Message.ClientId).attr("disabled", "disabled");
+                    $("#spId").val(r.Message.SpId);
+                    $("#productId").val(r.Message.ProductId).attr("disabled", "disabled");
+                    $("#_basicNum").val(r.Message.BasicNum, 0);
+                    $("#_givingNum").val(r.Message.GivingNum, 0); 
+                    $("#price").val(r.Message.Price / 1000, 0.00).attr("readonly", "readonly");
+                    $("#balance").val(r.Message.Balance / 1000, 0.00).attr("readonly", "readonly");
+                    //$("#payAmount").val(r.Message.PayAmount / 1000, 0);
+                    $("#remark").val(r.Message.Remark);
+
+                }, "json");
+            }
+        }
+
     </script>
 
     
diff --git a/web/web/GwOrderCreate.aspx.cs b/web/web/GwOrderCreate.aspx.cs
index 89b4cc8..ef84d05 100644
--- a/web/web/GwOrderCreate.aspx.cs
+++ b/web/web/GwOrderCreate.aspx.cs
@@ -16,11 +16,24 @@
 
     protected List<GwProduct> GwProductList;
     protected List<GwClient> GwClientList;
-    protected long Balance;
+    protected List<GwSp> GwSpList;
+    //杩斿洖URL
+    public string backUrl = "";
+
+    //鎺у埗鏍囧織锛�0-鎸夊鎴疯处鍙锋煡璇紱1-鎸堿PI璐﹀彿鏌ヨ
+    public int _controlFlag = 0;
+
+    private int _userId = -1;
+    private int _userType = -1;
+    private string _account = "";
 
     protected void Page_Load(object sender, EventArgs e)
     {
         //this.CheckRight("201", FailedOperation.ErrorMsgOnly);
+
+        _userId = this.AppContext.SessionObject.UserID;
+        _userType = this.AppContext.SessionObject.UserType;
+        _account = this.AppContext.SessionObject.Account;
 
         using (GwClientDao gwClientDao = new GwClientDao())
             this.GwClientList = gwClientDao.Clientlist();
@@ -37,7 +50,17 @@
 
         using (GwSpDao gwSpDao = new GwSpDao())
         {
-            if (!string.IsNullOrEmpty(this.SpID))
+            if (!string.IsNullOrEmpty(this.ClientId))
+            {
+                this.GwOrder = new GwOrder();
+                this.GwOrder.ClientId = ClientId;
+
+                string permissionsSQL = new GwClientDao().GetClientPermissions(_userId, _userType, null);
+                this.GwSpList = gwSpDao.LoadInfoList(null, null, this.ClientId, permissionsSQL);
+
+            }
+
+             if (!string.IsNullOrEmpty(this.SpID))
             {
                 GwSp  gwSp = gwSpDao.Get(this.SpID);
                 if(gwSp==null)
@@ -67,13 +90,9 @@
                     this.GwOrder.BasicNum = gwSp.BasicNum;  //鍩烘湰鏉℃暟
                     this.GwOrder.GivingNum = gwSp.GivingNum;
 
-                //this.Balance = gwSp.Balance;    //浣欓
-                this.Balance = long.Parse(gwClient.Balance.ToString() );    //浣欓
+                    this.GwOrder.Balance = long.Parse(gwClient.Balance.ToString());    //浣欓
             }
-            else
-            {
-                this.GwOrder = new GwOrder();
-            }
+
         }
     }
 
@@ -84,9 +103,30 @@
     {
         get
         {
+            if (!string.IsNullOrEmpty(this.AppContext.GetString("spId")))
+            {
+                backUrl = "GwSp.aspx";
+                _controlFlag = 1;
+            }
+
             return this.AppContext.GetString("spId");
         }
     }
+
+    public string ClientId
+    {
+        get
+        {
+            if(!string.IsNullOrEmpty(this.AppContext.GetString("clientId")) )
+            {
+                backUrl = "GwClient.aspx";
+                _controlFlag = 0;
+            }
+
+            return this.AppContext.GetString("clientId");
+        }
+    }
+
 
     //鑾峰彇浜у搧淇℃伅
     public string GetProductOptions(string productId)
@@ -94,7 +134,7 @@
         StringBuilder stringBuilder = new StringBuilder();
         if (this.GwProductList.Count == 0)
             return "<option value='0'>鏃�</option>";
-        stringBuilder.AppendFormat("<option value=\"{0}\" >{1}</option>", (object)0, (object)"鏃�");
+        stringBuilder.AppendFormat("<option value=\"{0}\" >{1}</option>", (object)"", (object)"鏃�");
         foreach (GwProduct bean in this.GwProductList)
         {
             //鍋滅敤鐨勪骇鍝佸垎绫讳笉鍐嶆樉绀�
@@ -103,10 +143,10 @@
                 continue;
             }
 
-            if (productId.Equals(bean.Id))
-                stringBuilder.AppendFormat("<option value=\"{0}\" selected>{0}-{1}</option>", (object)bean.Id, (object)bean.Name);
+            if (productId!=null && productId.Equals(bean.Id))
+                stringBuilder.AppendFormat("<option value=\"{0}\" selected>{1}</option>", (object)bean.Id, (object)bean.Name);
             else
-                stringBuilder.AppendFormat("<option value=\"{0}\">{0}-{1}</option>", (object)bean.Id, (object)bean.Name);
+                stringBuilder.AppendFormat("<option value=\"{0}\">{1}</option>", (object)bean.Id, (object)bean.Name);
         }
         return stringBuilder.ToString();
     }
@@ -117,14 +157,50 @@
         StringBuilder stringBuilder = new StringBuilder();
         if (this.GwClientList.Count == 0)
             return "<option value='0'>鏃�</option>";
-        stringBuilder.AppendFormat("<option value=\"{0}\" >{1}</option>", (object)0, (object)"鏃�");
+        stringBuilder.AppendFormat("<option value=\"{0}\" >{1}</option>", (object)"", (object)"鏃�");
         foreach (GwClient bean in this.GwClientList)
         {
-            if (clientId.Equals(bean.ClientID))
-                stringBuilder.AppendFormat("<option value=\"{0}\" selected>{0}-{1}</option>", (object)bean.ClientID, (object)bean.ClientName);
+            if (clientId!=null && clientId.Equals(bean.ClientID))
+                stringBuilder.AppendFormat("<option value=\"{0}\" selected>{1}</option>", (object)bean.ClientID, (object)bean.Company);
             else
-                stringBuilder.AppendFormat("<option value=\"{0}\">{0}-{1}</option>", (object)bean.ClientID, (object)bean.ClientName);
+                stringBuilder.AppendFormat("<option value=\"{0}\">{1}</option>", (object)bean.ClientID, (object)bean.Company);
         }
         return stringBuilder.ToString();
     }
+
+
+    //鑾峰彇瀹㈡埛API璐﹀彿淇℃伅
+    public string GetSpOptions()
+    {
+        StringBuilder stringBuilder = new StringBuilder();
+        if (this.GwClientList.Count == 0)
+            return "<option value='0'>鏃�</option>";
+        stringBuilder.AppendFormat("<option value=\"{0}\" >{1}</option>", (object)"", (object)"鏃�");
+        foreach (GwSp bean in this.GwSpList)
+        {
+            if (bean.Status == 0)
+            {
+                continue;
+            }
+
+            if (!string.IsNullOrEmpty(bean.SpID))
+                //stringBuilder.AppendFormat("<option value=\"{0}\" >{1}</option>", (object)bean.SpID, (object)ProductToName(bean.ProductId ) );
+                stringBuilder.AppendFormat("<option value=\"{0}\" >{0}</option>", (object)bean.SpID );
+
+        }
+        return stringBuilder.ToString();
+    }
+
+    //浜у搧鎴栦骇鍝佸垎绫籌D杞崲鍚嶇О
+    private string ProductToName(string productId)
+    {
+        if (this.GwProductList == null)
+            return string.Empty;
+        GwProduct bean = this.GwProductList.Find((Predicate<GwProduct>)(product => product.Id == productId));
+        if (bean != null)
+            //return string.Format("{0}-{1}", (object)bean.Id, (object)bean.Name);
+            return string.Format("{0}", (object)bean.Name);
+        return string.Empty;
+    }
+
 }
diff --git a/web/web/GwOrderList.aspx b/web/web/GwOrderList.aspx
index e6cf071..9f9cbe4 100644
--- a/web/web/GwOrderList.aspx
+++ b/web/web/GwOrderList.aspx
@@ -19,7 +19,7 @@
             function loadPageList() {
 
                 var clientId = $("#ClientID").val();
-                var clientName = $("#ClientName").val();
+                var company = $("#Company").val();
                 var spId = $("#SpID").val();
                 var startDate = $("#sDate").val();
                 var endDate = $("#eDate").val();
@@ -28,7 +28,7 @@
                     url: "GwOrder.ashx",
                     type: "POST",
                     //data: { action: "gwOrderList", SpID: SpID, ClientID: ClientID, ClientName: ClientName, sDate: sDate, EndTime: EndTime, pageSize: $("#pager").Pager("getPageSize"), pageIndex: $("#pager").Pager("getPageIndex") },
-                    data: { action: "gwOrderList", clientId: clientId, clientName: clientName, spId: spId, startDate: startDate, endDate: endDate, flag: -1, pageIndex: pagination.getPageIndex(), pageSize: pagination.getPageSize() },
+                    data: { action: "gwOrderList", clientId: clientId, company: company, spId: spId, startDate: startDate, endDate: endDate, flag: -1, pageIndex: pagination.getPageIndex(), pageSize: pagination.getPageSize() },
                 success: function (result) {
                         if (result.OK) {
                             $("#orderListTable tbody").html(result.Message.Table);
@@ -100,16 +100,16 @@
     class="form-inline">
     <div class="ibox">
         <div class="input-group m-b">
-            <span class="input-group-addon">SPID</span>
-            <input type="text" name="SpID" id="SpID" value="<%=SpID %>"" class="form-control" />
+            <span class="input-group-addon">瀹㈡埛璐﹀彿</span>
+            <input type="text" name="ClientID" id="ClientID" value="<%=ClientId %>" class="form-control" />
         </div>
         <div class="input-group m-b">
-            <span class="input-group-addon">瀹㈡埛ID</span>
-            <input type="text" name="ClientID" id="ClientID" class="form-control" />
+            <span class="input-group-addon">鍏徃鍚嶇О</span>
+            <input type="text" name="Company" id="Company" class="form-control " />
         </div>
         <div class="input-group m-b">
-            <span class="input-group-addon">瀹㈡埛鍚嶇О</span>
-            <input type="text" name="ClientName" id="ClientName" class="form-control " />
+            <span class="input-group-addon">鐭俊璐﹀彿</span>
+            <input type="text" name="SpID" id="SpID" value="<%=SpID %>" class="form-control" />
         </div>
         <div class="input-group m-b">
             <div class="input-daterange input-group " id="datepicker">
@@ -130,22 +130,22 @@
                 <tr class="header">
                     <th>璁㈠崟ID
                     </th>
-                    <th>璐﹀彿ID
+                    <th>鐭俊璐﹀彿
                     </th>
-                    <th>瀹㈡埛ID
+                    <th>瀹㈡埛璐﹀彿
                     </th>
-                    <th>浜у搧ID
+                    <th>浜у搧鍚嶇О
                     </th>
                     <%--<th>濂楅ID
                     </th>
                          --%>
-                    <th>璁㈠崟鍩烘湰鏉℃暟
+                    <th>璁㈠崟鍩烘湰鏉℃暟(鏉�)
                     </th>
-                    <th>璁㈠崟璧犻�佹潯鏁�
+                    <th>璁㈠崟璧犻�佹潯鏁�(鏉�)
                     </th>
                     <th>鍗曚环锛堝厓/鏉★級
                     </th>
-                    <th>璁㈠崟鎬绘潯鏁�
+                    <th>璁㈠崟鎬绘潯鏁�(鏉�)
                     </th>
                     <th>璁㈠崟鎬婚噾棰濓紙鍏冿級
                     </th>
@@ -153,13 +153,15 @@
                     </th>
                     <th>鍏呭�煎墠璐﹀彿浣欓锛堟潯锛�
                     </th>
+                    <th>瀹℃牳浜�(澶氱骇鎸夆��,鈥濆垎闅�)
+                    </th>
                     <th>鍒涘缓浜�
                     </th>
                     <th>鍒涘缓鏃堕棿
                     </th>
                     <th>鐘舵��
                     </th>
-                    <th class="text-right">鎿嶄綔
+                    <th class="text-center">鎿嶄綔
                     </th>
                 </tr>
             </thead>
@@ -198,14 +200,14 @@
                         </div>
                         <div class="form-group">
                             <label class="col-sm-2 control-label">
-                                璐﹀彿ID</label>
+                                鐭俊璐﹀彿</label>
                             <div class="col-sm-4 ">
                                 <input type="text" class="form-control" name="spId" id="spId" value="" />
                             </div>
                         </div>
                         <div class="form-group">
                             <label class="col-sm-2 control-label">
-                                瀹㈡埛ID</label>
+                                瀹㈡埛璐﹀彿</label>
                             <div class="col-sm-4 ">
                                 <select name="clientId" id="clientId" class="form-control">
                                     <%=GetClientOptions("0")%>
@@ -214,7 +216,7 @@
                         </div>
                         <div class="form-group">
                             <label class="col-sm-2 control-label">
-                                浜у搧ID</label>
+                                浜у搧鍚嶇О</label>
                             <div class="col-sm-4 ">
                                 <select name="productId" id="productId" class="form-control">
                                     <%=GetProductOptions("0")%>
diff --git a/web/web/GwOrderList.aspx.cs b/web/web/GwOrderList.aspx.cs
index 7a26a7d..1f2828e 100644
--- a/web/web/GwOrderList.aspx.cs
+++ b/web/web/GwOrderList.aspx.cs
@@ -14,6 +14,8 @@
 
     protected List<GwProduct> GwProductList;
     protected List<GwClient> GwClientList;
+    //杩斿洖URL
+    public string backUrl = "";
 
     public string sDate
     {
@@ -37,10 +39,28 @@
         }
     }
 
+    public string ClientId
+    {
+        get
+        {
+            if (!string.IsNullOrEmpty(this.AppContext.GetString("clientId")))
+            {
+                backUrl = "GwClient.aspx";
+            }
+
+            return this.AppContext.GetString("clientId");
+        }
+    }
+
     public string SpID
     {
         get
         {
+            if (!string.IsNullOrEmpty(this.AppContext.GetString("spId")))
+            {
+                backUrl = "GwSp.aspx";
+            }
+
             return this.AppContext.GetString("spId");
         }
     }
@@ -80,9 +100,9 @@
             }
 
             if (productId.Equals(bean.Id))
-                stringBuilder.AppendFormat("<option value=\"{0}\" selected>{0}-{1}</option>", (object)bean.Id, (object)bean.Name);
+                stringBuilder.AppendFormat("<option value=\"{0}\" selected>{1}</option>", (object)bean.Id, (object)bean.Name);
             else
-                stringBuilder.AppendFormat("<option value=\"{0}\">{0}-{1}</option>", (object)bean.Id, (object)bean.Name);
+                stringBuilder.AppendFormat("<option value=\"{0}\">{1}</option>", (object)bean.Id, (object)bean.Name);
         }
         return stringBuilder.ToString();
     }
@@ -97,9 +117,9 @@
         foreach (GwClient bean in this.GwClientList)
         {
             if (clientId.Equals(bean.ClientID))
-                stringBuilder.AppendFormat("<option value=\"{0}\" selected>{0}-{1}</option>", (object)bean.ClientID, (object)bean.ClientName);
+                stringBuilder.AppendFormat("<option value=\"{0}\" selected>{1}</option>", (object)bean.ClientID, (object)bean.Company);
             else
-                stringBuilder.AppendFormat("<option value=\"{0}\">{0}-{1}</option>", (object)bean.ClientID, (object)bean.ClientName);
+                stringBuilder.AppendFormat("<option value=\"{0}\">{1}</option>", (object)bean.ClientID, (object)bean.Company);
         }
         return stringBuilder.ToString();
     }
diff --git a/web/web/GwProduct.aspx b/web/web/GwProduct.aspx
index 3ff390a..a654cf9 100644
--- a/web/web/GwProduct.aspx
+++ b/web/web/GwProduct.aspx
@@ -245,7 +245,7 @@
                 <tr class="header">
                     <th>鍥炬爣
                     </th>
-                    <th>浜у搧绫诲埆
+                    <th>鎵�灞炰骇鍝佺被鍒�
                     </th>
                     <th>浜у搧鍚嶇О
                     </th>
@@ -310,7 +310,7 @@
                         </div>
                         <div class="form-group">
                             <label class="col-sm-2 control-label">
-                                鐖剁骇鍒嗙被</label>
+                                鎵�灞炰骇鍝佺被鍒�</label>
                             <div class="col-sm-4 ">
                                 <select name="parentId" id="parentId" class="form-control">
                                     <%=GetProductClassOptions("0")%>
@@ -355,6 +355,7 @@
                                 <input type="text" class="form-control" name="path" id="path" value="" />
                             </div>
                         </div>
+                        -->
                         <div class="form-group classes-span classes-span-1">
                             <label class="col-sm-2 control-label">
                                 鎺ㄥ箍鏂瑰紡</label>
@@ -366,7 +367,6 @@
                             </div>
                             <span class="help-block m-b-none">涓�у寲瀹㈡埛鏄寚鐗规畩鎺ㄩ�佺粰瀹㈡埛锛涚郴缁熼粯璁ゆ槸鎸囩郴缁熼粯璁ゅ彲鎺ㄩ�佹墍鏈夊鎴枫��</span>
                         </div>
-                        -->
                         <input type="hidden" class="form-control" name="isDefault" id="isDefault" value="1" />
                         <div class="form-group">
                             <label class="col-sm-2 control-label">
diff --git a/web/web/GwSpPrePattern.aspx b/web/web/GwSpPrePattern.aspx
index 50617dc..ca9fe66 100644
--- a/web/web/GwSpPrePattern.aspx
+++ b/web/web/GwSpPrePattern.aspx
@@ -233,49 +233,52 @@
             </div>
             <div class="input-group m-b">
                 <input type="button" value="鏌ヨ" class="btn btn-primary action-query" />
-                <input type="button" value="鎵归噺瀹℃牳" class="btn btn-danger action-modal-status" />
             </div>
         </div>
     </div>
     </form>
-    <table class="table table-striped table-bordered table-hover" id="gwSpPreTable">
-        <thead>
-            <tr class="header">
-                <th>
-                    <input type="checkbox" name="check-all-row" id="check-all-row" value="" />
-                </th>
-                <th class="col-md-1">
-                    瀹㈡埛璐﹀彿
-                </th>
-                <th class="col-md-1">
-                    鐭俊璐﹀彿
-                </th>
-                <th class="col-md-5">
-                    鎶ュ鍐呭
-                </th>
-                <th class="col-md-1">
-                    鍒涘缓鏃堕棿
-                </th>
-                <th class="col-md-1">
-                    瀹℃牳鐘舵��
-                </th>
-                <th class="col-md-1">
-                    瀹℃牳鏃堕棿
-                </th>
-                <th class="col-md-1">
-                    瀹℃牳澶囨敞
-                </th>
-                <th class="col-md-1">
-                    瀹℃牳鍛�
-                </th>
-                <th class="col-md-1">
-                    鎿嶄綔
-                </th>
-            </tr>
-        </thead>
-        <tbody>
-        </tbody>
-    </table>
+        
+    <div class="table-responsive">
+                <input type="button" value="鎵归噺瀹℃牳" class="btn btn-danger action-modal-status" />
+        <table class="table table-striped table-bordered table-hover" id="gwSpPreTable">
+            <thead>
+                <tr class="header">
+                    <th>
+                        <input type="checkbox" name="check-all-row" id="check-all-row" value="" />
+                    </th>
+                    <th class="col-md-1">
+                        瀹㈡埛璐﹀彿
+                    </th>
+                    <th class="col-md-1">
+                        鐭俊璐﹀彿
+                    </th>
+                    <th class="col-md-5">
+                        鎶ュ鍐呭
+                    </th>
+                    <th class="col-md-1">
+                        鍒涘缓鏃堕棿
+                    </th>
+                    <th class="col-md-1">
+                        瀹℃牳鐘舵��
+                    </th>
+                    <th class="col-md-1">
+                        瀹℃牳鏃堕棿
+                    </th>
+                    <th class="col-md-1">
+                        瀹℃牳澶囨敞
+                    </th>
+                    <th class="col-md-1">
+                        瀹℃牳鍛�
+                    </th>
+                    <th class="col-md-1">
+                        鎿嶄綔
+                    </th>
+                </tr>
+            </thead>
+            <tbody>
+            </tbody>
+        </table>
+    </div>
     <div id="pagination">
     </div>
 
diff --git a/web/web/Index.aspx b/web/web/Index.aspx
index e729faa..aabf61e 100644
--- a/web/web/Index.aspx
+++ b/web/web/Index.aspx
@@ -190,7 +190,8 @@
                     <li>
                         <a href="#"><i class="fa fa-user-secret"></i><span class="nav-label">瀹㈡埛绠$悊 </span><span class="fa arrow"></span></a>
                         <ul class="nav nav-second-level">
-                            <li><a href="GwClient.aspx" class="J_menuItem">瀹㈡埛淇℃伅绠$悊</a> </li>
+                            <li><a href="GwClient.aspx?IsEnable=1" class="J_menuItem">瀹㈡埛淇℃伅绠$悊</a> </li>
+                            <li><a href="GwClient.aspx?IsEnable=0" class="J_menuItem">鍋滅敤瀹㈡埛淇℃伅绠$悊</a> </li>
                             <li><a href="GwSp.aspx" class="J_menuItem">鐭俊璐﹀彿绠$悊</a> </li>
                             <li><a href="GwMoRoute.aspx" class="J_menuItem">涓婅璺敱閰嶇疆</a> </li>
                             <!--<li><a href="GwSpChargeLog.aspx" class="J_menuItem">鍏呭�艰褰曟煡璇�</a> </li>-->
diff --git a/web/web/Main.master b/web/web/Main.master
index 7c34efa..260f809 100644
--- a/web/web/Main.master
+++ b/web/web/Main.master
@@ -19,6 +19,7 @@
 <link href="css/plugins/sweetalert/sweetalert.css" rel="stylesheet"/>
 <link href="css/plugins/datapicker/datepicker3.css" rel="stylesheet"/>
 <link href="css/jquery.numberedtextarea.css" rel="stylesheet"/>
+<link href="js/plugins/layui/css/layui.css" rel="stylesheet"/>
 <script src="js/loading.js" type="text/javascript"></script>
 
 <!-- 姝e紡浣跨敤鍚敤锛岃皟璇曠鐢� -->
@@ -43,6 +44,9 @@
 <script type="text/javascript" src="/js/jquery-form.js"></script>
 <script type="text/javascript" src="/js/jquery.numberedtextarea.js"></script>
 <script type="text/javascript" src="/js/mytek-pager.js"></script>
+<!--缃戦〉鍛戒护鎿嶄綔锛氬澶嶅埗-->
+<script type="text/javascript" src="/js/clipboard.min.js"></script>
+<script type="text/javascript" src="/js/plugins/layui/layui.js"></script>
 
  
 

--
Gitblit v1.9.1