From 1b9a56fcf3ffcf0f69ed8b7447322d0a75ba99ac Mon Sep 17 00:00:00 2001
From: wzp <2040239371@qq.com>
Date: 星期四, 02 三月 2023 15:31:14 +0800
Subject: [PATCH] 清理dataAccess,避免报错

---
 web/web/GwClient.ashx |   28 +++++++++++++++++++++-------
 1 files changed, 21 insertions(+), 7 deletions(-)

diff --git a/web/web/GwClient.ashx b/web/web/GwClient.ashx
index d7bd4e7..ebb9d56 100644
--- a/web/web/GwClient.ashx
+++ b/web/web/GwClient.ashx
@@ -117,11 +117,13 @@
         string serverIp = ConfigurationManager.AppSettings["serverIp"];
         string clientPort = ConfigurationManager.AppSettings["clientPort"];
 
+        int isSub = context.GetInt("isSub",0);
+
         string str = "";
         using (GwClientDao dao = new GwClientDao())
         {
             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);
+            var list = dao.LoadInfoList(out recordCount, pageIndex, pageSize, ClientID, ClientName, Telephone, Agent, Company, Salesman, SupportStaff, ProductId, IsEnable,isSub, permissionsSQL);
 
             if (list != null && list.Count > 0)
             {
@@ -158,9 +160,9 @@
                         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-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 += @"閲嶇疆瀵嗙爜";
@@ -419,7 +421,7 @@
         string financialStaff = context.GetString("financialStaff");
         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");
@@ -530,7 +532,7 @@
         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.IsEnableWhite = string.IsNullOrEmpty(isEnableWhite) ? 0 : int.Parse(isEnableWhite);
         client.IsEnableBlack = string.IsNullOrEmpty(isEnableBlack) ? 0 : int.Parse(isEnableBlack);
@@ -553,6 +555,8 @@
     ///鍒涘缓鏂板鎴�
     private JsonPageResult Save(PageContext<Model.SysUser> context)
     {
+
+        //娴嬭瘯
         string clientID = context.GetString("clientID");
         string password = context.GetString("password");
         string clientName = context.GetString("clientName");
@@ -594,6 +598,16 @@
         if (string.IsNullOrEmpty(clientID))
         {
             throw new ArgumentException("瀹㈡埛璐﹀彿涓嶈兘涓虹┖锛屼笖蹇呴』涓哄叕鍙稿悕绉帮紒");
+        }
+
+        if (address.Length >= 150)
+        {
+            throw new ArgumentException("鍦板潃闀垮害瓒呭嚭闄愬埗锛�");
+        }
+
+        if (string.IsNullOrEmpty(company))
+        {
+            throw new AggregateException("鍏徃鍚嶇О涓嶈兘涓虹┖锛屼笖蹇呴』鏄叏绉�");
         }
 
         if (string.IsNullOrEmpty(password) || !System.Text.RegularExpressions.Regex.IsMatch(password, @"[a-zA-Z0-9]{4,10}"))
@@ -710,7 +724,7 @@
         client.Telephone = telephone;
         client.Agent = agent;
         client.PermissionData = permissionData;
-        client.ParentId = context.OperatorID;
+        client.Client_Parentid = context.OperatorID;
         client.Certification_Status = 1;
         client.Company = company;
         client.CustomerManager = customerManager;

--
Gitblit v1.9.1