MicroWin10-1604\Administrator 7 lat temu
rodzic
commit
7db4dbfda1

+ 64 - 26
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/tel/MobiledataController.cs

323
                 }
323
                 }
324
                 if (locstr.Trim() != "")
324
                 if (locstr.Trim() != "")
325
                 {
325
                 {
326
-                    sql += " and (province like '%"+locstr+ "%' or city like '%" + locstr + "%')";
326
+                    sql += " and (province like '%" + locstr + "%' or city like '%" + locstr + "%')";
327
                 }
327
                 }
328
 
328
 
329
                 if (strpageindex.Trim() != "")
329
                 if (strpageindex.Trim() != "")
397
                 BLL.telloc_users dBLL = new BLL.telloc_users();
397
                 BLL.telloc_users dBLL = new BLL.telloc_users();
398
                 Model.telloc_users dModel = new Model.telloc_users();
398
                 Model.telloc_users dModel = new Model.telloc_users();
399
 
399
 
400
-                if (type == 1)//0为添加,1是解除
400
+                //if (type == 1)//0为添加,1是解除
401
+                //{
402
+                //    dModel = dBLL.GetModel(userid,tellocid);
403
+                //    if (dModel != null)
404
+                //    {
405
+                //        dModel.isdelete = 1;
406
+                //        bool b = dBLL.Update(dModel);
407
+                //        if (b)
408
+                //        {
409
+                //            res = Success("解除成功");
410
+                //        }
411
+                //        else
412
+                //        {
413
+                //            res = Error("解除失败");
414
+                //        }
415
+                //    }
416
+                //    else
417
+                //    {
418
+                //        res = Error("解除失败");
419
+                //    }
420
+                //}
421
+                //else
422
+                //{
423
+                //    dModel = new Model.telloc_users();
424
+                //    if (!string.IsNullOrWhiteSpace(tellocid.ToString()))
425
+                //    {
426
+                //        dModel.tellocid = tellocid;
427
+                //    }
428
+                //    if (!string.IsNullOrWhiteSpace(userid.ToString()))
429
+                //    {
430
+                //        dModel.userid = userid;
431
+                //    }
432
+                //    dModel.isdelete = 0;
433
+                //    int n = new BLL.telloc_users().Add(dModel);
434
+                //    if (n > 0)
435
+                //    {
436
+                //        res = Success("添加成功", n);
437
+                //    }
438
+                //    else
439
+                //    {
440
+                //        res = Error("添加失败");
441
+                //    }
442
+                //}
443
+
444
+
445
+                dModel = new Model.telloc_users();
446
+                if (!string.IsNullOrWhiteSpace(tellocid.ToString()))
401
                 {
447
                 {
402
-                    dModel = dBLL.GetModel(userid,tellocid);
403
-                    if (dModel != null)
448
+                    dModel.tellocid = tellocid;
449
+                }
450
+                if (!string.IsNullOrWhiteSpace(userid.ToString()))
451
+                {
452
+                    dModel.userid = userid;
453
+                }
454
+                dModel = dBLL.GetModel(userid, tellocid);
455
+                if (dModel != null)
456
+                {
457
+                    dModel.isdelete = type;
458
+                    bool b = dBLL.Update(dModel);
459
+                    var str = type == 1 ? "解除" : "添加";
460
+                    if (b)
404
                     {
461
                     {
405
-                        dModel.isdelete = 1;
406
-                        bool b = dBLL.Update(dModel);
407
-                        if (b)
408
-                        {
409
-                            res = Success("解除成功");
410
-                        }
411
-                        else
412
-                        {
413
-                            res = Error("解除失败");
414
-                        }
462
+                        res = Success(str + "成功");
415
                     }
463
                     }
416
                     else
464
                     else
417
                     {
465
                     {
418
-                        res = Error("解除失败");
466
+                        res = Error(str + "失败");
419
                     }
467
                     }
420
                 }
468
                 }
421
                 else
469
                 else
422
                 {
470
                 {
423
-                    dModel = new Model.telloc_users();
424
-                    if (!string.IsNullOrWhiteSpace(tellocid.ToString()))
425
-                    {
426
-                        dModel.tellocid = tellocid;
427
-                    }
428
-                    if (!string.IsNullOrWhiteSpace(userid.ToString()))
429
-                    {
430
-                        dModel.userid = userid;
431
-                    }
432
                     dModel.isdelete = 0;
471
                     dModel.isdelete = 0;
433
                     int n = new BLL.telloc_users().Add(dModel);
472
                     int n = new BLL.telloc_users().Add(dModel);
434
                     if (n > 0)
473
                     if (n > 0)
440
                         res = Error("添加失败");
479
                         res = Error("添加失败");
441
                     }
480
                     }
442
                 }
481
                 }
443
-
444
             }
482
             }
445
             return res;
483
             return res;
446
         }
484
         }
489
             if (Request.IsAuthenticated)
527
             if (Request.IsAuthenticated)
490
             {
528
             {
491
                 BLL.T_Sys_SeatGroup dBLL = new BLL.T_Sys_SeatGroup();
529
                 BLL.T_Sys_SeatGroup dBLL = new BLL.T_Sys_SeatGroup();
492
-                var seatgroups = dBLL.GetModelList("1=1").Select(n=>new { n.F_ZXZID,n.F_ZXZName});
530
+                var seatgroups = dBLL.GetModelList("1=1").Select(n => new { n.F_ZXZID, n.F_ZXZName });
493
                 res = Success("获取坐席组成功", seatgroups);
531
                 res = Success("获取坐席组成功", seatgroups);
494
             }
532
             }
495
             return res;
533
             return res;