Quellcode durchsuchen

工单类型修改

machenyang vor 8 Jahren
Ursprung
Commit
96e790d59b

+ 12 - 12
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkTypeController.cs

@@ -22,7 +22,6 @@ namespace CallCenterApi.Interface.Controllers.workorder
22 22
         public ActionResult GetTreeList()
23 23
         {
24 24
             ActionResult res = NoToken("未知错误,请重新登录");
25
-            string resstr = "";
26 25
             if (Request.IsAuthenticated)
27 26
             {
28 27
                 DataTable dt = new DataTable();
@@ -36,12 +35,12 @@ namespace CallCenterApi.Interface.Controllers.workorder
36 35
                         System.Collections.Generic.List<Model.TreeModel> modelList = BindTree(dt, "0");
37 36
                         //将对象转为json字符串
38 37
                         //resstr = new JavaScriptSerializer().Serialize(modelList);
39
-                        res = Success("", modelList);
38
+                        res = Success("获取成功", modelList);
40 39
                     }
41 40
                 }
42
-                catch (Exception err)
41
+                catch (Exception e)
43 42
                 {
44
-                    //res = err.ToString(); 
43
+                    res = Error("获取失败" + e.Message);
45 44
                 }
46 45
                 finally
47 46
                 {
@@ -86,7 +85,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
86 85
         /// 添加/修改工单类别
87 86
         /// </summary>
88 87
         /// <returns></returns>
89
-        public ActionResult Init()
88
+        public ActionResult Add()
90 89
         {
91 90
             ActionResult res = NoToken("未知错误,请重新登录");
92 91
             string id = RequestString.GetQueryString("id");
@@ -99,11 +98,11 @@ namespace CallCenterApi.Interface.Controllers.workorder
99 98
                     parentid = pid,
100 99
                     sort = sort
101 100
                 };
102
-                res = Success("", obj);
101
+                res = Success("获取成功", obj);
103 102
             }
104 103
             catch (Exception e)
105 104
             {
106
-                res = Error(e.Message);
105
+                res = Error("获取失败" + e.Message);
107 106
             }
108 107
             return res;
109 108
         }
@@ -117,7 +116,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
117 116
             int bl = new BLL.T_RepositoryCategory().Add(T_RepositoryCategory);
118 117
             if (bl > 0)
119 118
             {
120
-                res = Success("新增成功");
119
+                res = Success("新增成功", T_RepositoryCategory);
121 120
             }
122 121
             else
123 122
             {
@@ -168,10 +167,10 @@ namespace CallCenterApi.Interface.Controllers.workorder
168 167
         /// </summary>
169 168
         /// <param name="f_catagoryid">要删除的工单类别的类别id</param>
170 169
         /// <returns></returns>
171
-        public string DeleteWoType(string f_catagoryid)
170
+        public ActionResult DeleteWoType(string f_catagoryid)
172 171
         {
173 172
             //获取它下面的子类别
174
-            string res = "";
173
+            ActionResult res = NoToken("未知错误,请重新登录");
175 174
             DataTable dt = new BLL.T_RepositoryCategory().GetList("F_DeleteFlag=0 and F_ParentId=" + Convert.ToInt32(f_catagoryid) + " and F_CategoryType=1").Tables[0];
176 175
             string rid = string.Empty;
177 176
             if (dt.Rows.Count > 0)
@@ -195,10 +194,11 @@ namespace CallCenterApi.Interface.Controllers.workorder
195 194
                             }
196 195
                         }
197 196
                     }
197
+                    res = Success("删除成功");
198 198
                 }
199 199
                 catch (Exception e)
200 200
                 {
201
-                    res = e.Message;
201
+                    res = Error("删除失败");
202 202
                 }
203 203
             }
204 204
             return res;
@@ -215,7 +215,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
215 215
             get
216 216
             {
217 217
                 Model.T_RepositoryCategory _model = new Model.T_RepositoryCategory();
218
-                id = RequestString.GetQueryString("id");
218
+                id = RequestString.GetFormString("id");
219 219
                 if (id.Trim() != "")
220 220
                 {
221 221
                     _model.F_CategoryId = Convert.ToInt32(id.Trim());