mengjie лет назад: 6
Родитель
Сommit
c8cf0bb720

+ 20 - 0
codegit/CallCenterApi/CallCenterApi.BLL/T_Call_LeaveRecord.cs

@@ -152,5 +152,25 @@ namespace CallCenterApi.BLL
152 152
         #region  ExtensionMethod
153 153
 
154 154
         #endregion  ExtensionMethod
155
+
156
+        #region 开启关闭留言
157
+        /// <summary>
158
+        /// 获取留言功能启用状态
159
+        /// </summary>
160
+        public int GetLRState()
161
+        {
162
+            return dal.GetLRState();
163
+        }
164
+
165
+        /// <summary>
166
+        /// 更新转留言功能启用标志
167
+        /// </summary>
168
+        /// <param name="state"></param>
169
+        /// <returns></returns>
170
+        public bool UpdateState(int state)
171
+        {
172
+            return dal.UpdateState(state );
173
+        }
174
+        #endregion
155 175
     }
156 176
 }

+ 50 - 0
codegit/CallCenterApi/CallCenterApi.DAL/T_Call_LeaveRecord.cs

@@ -408,5 +408,55 @@ namespace CallCenterApi.DAL
408 408
         #region  ExtensionMethod
409 409
 
410 410
         #endregion  ExtensionMethod
411
+
412
+        #region 开启关闭留言
413
+        /// <summary>
414
+        /// 获取留言功能启用状态
415
+        /// </summary>
416
+        public int GetLRState()
417
+        {
418
+            StringBuilder strSql = new StringBuilder();
419
+            strSql.Append("select F_IsClosed FROM T_Call_LRState ");
420
+            
421
+            object obj = DbHelperSQL.GetSingle(strSql.ToString());
422
+            if (obj == null)
423
+            {
424
+                return 0;
425
+            }
426
+            else
427
+            {
428
+                return Convert.ToInt32(obj);
429
+            }
430
+        }
431
+
432
+        /// <summary>
433
+        /// 更新转留言功能启用标志
434
+        /// </summary>
435
+        /// <param name="state"></param>
436
+        /// <returns></returns>
437
+        public bool UpdateState(int state)
438
+        {
439
+
440
+            StringBuilder strSql = new StringBuilder();
441
+            //strSql.Append("delete from T_Call_OutTask ");
442
+            strSql.Append("update T_Call_LRState set F_IsClosed=@F_IsClosed ");
443
+            
444
+            SqlParameter[] parameters = {
445
+                    new SqlParameter("@F_IsClosed", SqlDbType.Int,4)
446
+                    
447
+            };
448
+            parameters[0].Value = state;
449
+            
450
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
451
+            if (rows > 0)
452
+            {
453
+                return true;
454
+            }
455
+            else
456
+            {
457
+                return false;
458
+            }
459
+        }
460
+        #endregion
411 461
     }
412 462
 }

+ 35 - 0
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/tel/CallleaveController.cs

@@ -165,5 +165,40 @@ namespace CallCenterApi.Interface.Controllers.tel
165 165
             }
166 166
             return res;
167 167
         }
168
+
169
+
170
+        //更新留言功能启用状态
171
+        public ActionResult UpdateLRState(int state)
172
+        {
173
+            ActionResult res = NoToken("未知错误,请重新登录");
174
+            if (Request.IsAuthenticated)
175
+            {
176
+                if (new BLL.T_Call_LeaveRecord().UpdateState(state))
177
+                {
178
+                    res = Success("更新成功");
179
+                }
180
+                else
181
+                {
182
+                    res = Error("更新失败");
183
+                }
184
+                
185
+            }
186
+            return res;
187
+        }
188
+
189
+        //获取留言功能启用状态
190
+        public ActionResult GetLRState()
191
+        {
192
+            ActionResult res = NoToken("未知错误,请重新登录");
193
+            if (Request.IsAuthenticated)
194
+            {
195
+                int state=new BLL.T_Call_LeaveRecord().GetLRState();
196
+                
197
+                res = Success("获取成功",state );
198
+                
199
+
200
+            }
201
+            return res;
202
+        }
168 203
     }
169 204
 }

+ 10 - 0
codegit/CallCenterApi/CallCenterApi.Model/T_Call_LeaveRecord.cs

@@ -153,5 +153,15 @@ namespace CallCenterApi.Model
153 153
             get { return _f_connum; }
154 154
         }
155 155
         #endregion Model
156
+
157
+        #region 留言功能开启或关闭
158
+        private int _f_isclosed;
159
+
160
+        public int F_IsClosed
161
+        {
162
+            set { _f_isclosed = value; }
163
+            get { return _f_isclosed; }
164
+        }
165
+        #endregion
156 166
     }
157 167
 }