Selaa lähdekoodia

修改有关电话号码格式的bug

mengjie 8 vuotta sitten
vanhempi
commit
20ce2eb39f

+ 4 - 1
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/LogController.cs

@@ -22,6 +22,7 @@ namespace CallCenterApi.Interface.Controllers
22 22
         public ActionResult GetList(FilterLog filter)
23 23
         {
24 24
             var res = NoToken("未知错误,请重新登录");
25
+            
25 26
             if (Request.IsAuthenticated)
26 27
             {
27 28
                 var sql = "";
@@ -31,7 +32,9 @@ namespace CallCenterApi.Interface.Controllers
31 32
                 }
32 33
                 if (filter.LoginDate != null)
33 34
                 {
34
-                    sql += " and CONVERT(varchar , F_LoginDate, 120)>=CONVERT(varchar , '" + filter.LoginDate.ToString() + " 00:00:01', 120) and CONVERT(varchar , F_LoginDate, 120)<=CONVERT(varchar , '" + filter.LoginDate.ToString() + " 23:59:59', 120) ";
35
+                    DateTime ctime = Convert.ToDateTime(filter.LoginDate);
36
+                    string checkdate = ctime.ToString("yyyy-MM-dd");
37
+                    sql += " and CONVERT(varchar , F_LoginDate, 120)>=CONVERT(varchar , '" + checkdate + " 00:00:01', 120) and CONVERT(varchar , F_LoginDate, 120)<=CONVERT(varchar , '" + checkdate + " 23:59:59', 120) ";
35 38
                 }
36 39
                 int recordCount = 0;
37 40
                 var dt = BLL.PagerBLL.GetListPager(

+ 19 - 2
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/customer/CustomerController.cs

@@ -142,8 +142,25 @@ namespace CallCenterApi.Interface.Controllers.customer
142 142
                         string mobile = RequestString.GetFormString("mobile");
143 143
                         string telphone = RequestString.GetFormString("telphone");
144 144
                         string chargetelephone = RequestString.GetFormString("chargetelephone");
145
-                        //2017-11-1
146
-                        string caddr= RequestString.GetFormString("caddr");
145
+                    #region 判断输入数据类型
146
+                    if (mobile!=""&&!Utils.IsNumeric(mobile))
147
+                    {
148
+                        res = Error("电话必须为数字");
149
+                        return res;
150
+                    }
151
+                    if (telphone != "" && !Utils.IsNumeric(telphone))
152
+                    {
153
+                        res = Error("电话必须为数字");
154
+                        return res;
155
+                    }
156
+                    if (chargetelephone != "" && !Utils.IsNumeric(chargetelephone))
157
+                    {
158
+                        res = Error("电话必须为数字");
159
+                        return res;
160
+                    }
161
+                    #endregion
162
+                    //2017-11-1
163
+                    string caddr = RequestString.GetFormString("caddr");
147 164
                         int  autoflag = Utils.StrToInt(RequestString.GetFormString("autoflag"),0);
148 165
                         string cresult = RequestString.GetFormString("cresult");
149 166
                         int cid = Utils.StrToInt(RequestString.GetFormString("cid"), 0);

+ 9 - 0
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/tel/CallInScreenController.cs

@@ -517,6 +517,15 @@ namespace CallCenterApi.Interface.Controllers.tel
517 517
                 int unitid = RequestString.GetInt("unitid", 0);//交办单位
518 518
                 #endregion
519 519
                 #endregion
520
+
521
+                #region 判断输入数据类型
522
+                if (!Utils.IsNumeric(tsdh))
523
+                {
524
+                    res = Error("电话必须为数字");
525
+                    return res;
526
+                }
527
+                #endregion
528
+
520 529
                 int userId = CurrentUser.UserData.F_UserId;
521 530
                 if (userId != 0)
522 531
                 {

+ 7 - 0
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderController.cs

@@ -523,6 +523,13 @@ namespace CallCenterApi.Interface.Controllers.workorder
523 523
                         int khid = RequestString.GetInt("khid", 0);
524 524
                         string tskh = RequestString.GetFormString("tskh");
525 525
                         string tsdh = RequestString.GetFormString("tsdh");
526
+                        #region 判断输入数据类型
527
+                        if (!Utils.IsNumeric(tsdh))
528
+                        {
529
+                            res = Error("电话必须为数字");
530
+                            return res;
531
+                        }
532
+                        #endregion
526 533
                         //int zrbm = RequestString.GetInt("zrbm", 0);
527 534
                         //int zrid = RequestString.GetInt("zrid", 0);
528 535
                         string cont = RequestString.GetFormString("cont");