浏览代码

部门读取

zhengbingbing 7 年之前
父节点
当前提交
76abcc564b

+ 9 - 1
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/customer/CustomerNewController.cs

@@ -93,7 +93,8 @@ namespace CallCenterApi.Interface.Controllers.customer
93 93
                 out recordCount);
94 94
             #region
95 95
             dt.Columns.Add("F_Contact");
96
-            var dicvalue = new BLL.T_Sys_DictionaryValue().GetModelList("");
96
+            dt.Columns.Add("F_DeptName");
97
+            var dept = new BLL.T_Sys_Department().GetModelList("");
97 98
             foreach (DataRow dr in dt.Rows)
98 99
             {
99 100
                 #region 绑定联系人信息
@@ -114,6 +115,13 @@ namespace CallCenterApi.Interface.Controllers.customer
114 115
                 #endregion
115 116
                 #region 客户归属部门
116 117
                 //F_BeDept
118
+                string deptid = dr["F_BeDept"] != null ? dr["F_BeDept"].ToString() : "";
119
+                if (deptid != "")
120
+                {
121
+                    var deptmodel = dept.Where(d => d.F_DeptId == int.Parse(deptid)).FirstOrDefault();
122
+                    if (deptmodel != null)
123
+                        dr["F_DeptName"] = deptmodel.F_DeptName;
124
+                }
117 125
                 #endregion
118 126
             }
119 127