MicroWin10-1604\Administrator %!s(int64=7) %!d(string=před) roky
rodič
revize
5654eb697b

+ 21 - 15
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/customer/CustomerController.cs

@@ -210,23 +210,29 @@ namespace CallCenterApi.Interface.Controllers.customer
210 210
                     //添加或修改时要根据电话判断是否已有记录
211 211
                     if (cid == 0)
212 212
                     {
213
-                        model.F_CustomerName = name;
214
-                        model.F_Province = province;
215
-                        model.F_CustomerIndustry = customerindustry;
216
-                        //统一为F_Telephone
217
-                        model.F_Telephone = mobile;
218
-
219
-                        model.F_CreateBy = userId;
220
-                        model.F_CreatedOn = DateTime.Now;
221
-                        model.F_DeleteFlag = 0;
222
-                        int n = bll.Add(model);
223
-                        if (n > 0)
224
-                        {
225
-                            return Success("新增成功!", model);
226
-                        }
213
+                        var cusmodel = bll.GetModelList("F_Telephone='" + mobile + "' AND F_DeleteFlag = 0");
214
+                        if (cusmodel.Count() > 0)
215
+                            return Error("已存在该号码的用户,请直接编辑!");
227 216
                         else
228 217
                         {
229
-                            return Error("新增失败!");
218
+                            model.F_CustomerName = name;
219
+                            model.F_Province = province;
220
+                            model.F_CustomerIndustry = customerindustry;
221
+                            //统一为F_Telephone
222
+                            model.F_Telephone = mobile;
223
+
224
+                            model.F_CreateBy = userId;
225
+                            model.F_CreatedOn = DateTime.Now;
226
+                            model.F_DeleteFlag = 0;
227
+                            int n = bll.Add(model);
228
+                            if (n > 0)
229
+                            {
230
+                                return Success("新增成功!", model);
231
+                            }
232
+                            else
233
+                            {
234
+                                return Error("新增失败!");
235
+                            }
230 236
                         }
231 237
                     }
232 238
                     else

File diff suppressed because it is too large
+ 198 - 47
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderController.cs