mengjie 6 vuotta sitten
vanhempi
commit
5ba49e1d16

+ 6 - 5
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/customer/CustomerNewController.cs

@@ -265,8 +265,8 @@ namespace CallCenterApi.Interface.Controllers.customer
265 265
             #region 添加验证判断
266 266
             if (string.IsNullOrEmpty(input.F_CustomerCode))
267 267
                 return Error("编号不能为空!");
268
-            if (getunique(0, input.F_CustomerCode, input.F_CompanyName))
269
-                return Error("编号已被占用,请重新输入!");
268
+            //if (getunique(0, input.F_CustomerCode, input.F_CompanyName))
269
+            //    return Error("编号已被占用,请重新输入!");
270 270
             #endregion
271 271
             var model = new Model.T_Cus_CustomerBaseNew();
272 272
             #region 保存客户基本信息
@@ -327,8 +327,8 @@ namespace CallCenterApi.Interface.Controllers.customer
327 327
             #region 添加验证判断
328 328
             if (input.F_CustomerId <= 0)
329 329
                 return Error("参数错误!");
330
-            if (getunique(input.F_CustomerId, input.F_CustomerCode, input.F_CompanyName))
331
-                return Error("编号已被占用,请重新输入!");
330
+            //if (getunique(input.F_CustomerId, input.F_CustomerCode, input.F_CompanyName))
331
+            //    return Error("编号已被占用,请重新输入!");
332 332
             #endregion
333 333
             var model = cusbll.GetModel(input.F_CustomerId);
334 334
             #region 保存客户基本信息
@@ -455,7 +455,7 @@ namespace CallCenterApi.Interface.Controllers.customer
455 455
         private bool getunique(int id, string code,string name)
456 456
         {
457 457
             var sql = " F_DeleteFlag=0 ";
458
-            sql += "and (F_CustomerCode='" + code + "' or F_CompanyName='"+ name + "')";
458
+            sql += "and (F_CustomerCode='" + code + ")";//' or F_CompanyName='"+ name + "'
459 459
             if (id > 0)
460 460
                 sql += " and F_CustomerId<>"+id;
461 461
             var count=cusbll.GetModelList(sql).Count();
@@ -600,6 +600,7 @@ namespace CallCenterApi.Interface.Controllers.customer
600 600
             conmodel.F_CreateBy = usercode;
601 601
             conmodel.F_CreateOn = DateTime.Now;
602 602
             conmodel.F_DeleteFlag = 0;
603
+            
603 604
             int n = conbll.Add(conmodel);
604 605
             if (n > 0)
605 606
                 return Success("联系人保存成功!");