machenyang лет назад: 8
Родитель
Сommit
96e790d59b

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

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