Procházet zdrojové kódy

添加欢迎词启动判断

mengjie %!s(int64=5) %!d(string=před) roky
rodič
revize
067ce88081

+ 19 - 0
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/IVRWordsController.cs

@@ -124,6 +124,15 @@ namespace CallCenterApi.Interface.Controllers
124 124
             //    return Error("生效时间不能为空!");
125 125
             //if (string.IsNullOrEmpty(input.EndDate.ToString()))
126 126
             //    return Error("失效时间不能为空!");
127
+            if (input.IsState == 1)
128
+            {
129
+                //判断只能启动一条欢迎词
130
+                var list = bll.GetModelList(" IsDelete = 0 AND IsState = 1 AND GroupCode ='" + input.GroupCode + "' ");
131
+                if (list.Count() > 0)
132
+                {
133
+                    return Error("不能同时启用两条欢迎词,若要启用此条请先关掉之前启用的!");
134
+                }
135
+            }
127 136
             #endregion
128 137
             var model = new Model.T_Sys_IVRWords();
129 138
             //获取房东信息            
@@ -135,6 +144,7 @@ namespace CallCenterApi.Interface.Controllers
135 144
             model.StartDate = input.StartDate;    // 生效时间
136 145
             model.EndDate = input.EndDate;                // 失效时间
137 146
             model.Remark = input.Remark;                // 备注
147
+            
138 148
             model.IsState = input.IsState;    // 状态:1启动,0不启动
139 149
             model.CreateBy = usercode;              // 备注
140 150
             model.CreateTime = DateTime.Now;
@@ -167,6 +177,15 @@ namespace CallCenterApi.Interface.Controllers
167 177
             var model = bll.GetModel(input.ID);
168 178
             if (model == null)
169 179
                 return Error("参数错误");
180
+            if (input.IsState == 1)
181
+            {
182
+                //判断只能启动一条欢迎词
183
+                var list = bll.GetModelList(" IsDelete = 0 AND IsState = 1 AND GroupCode ='" + input.GroupCode + "' ");
184
+                if (list.Count() > 0)
185
+                {
186
+                    return Error("不能同时启用两条欢迎词,若要启用此条请先关掉之前启用的!");
187
+                }
188
+            }
170 189
 
171 190
             //获取房东信息            
172 191
             model.Title = input.Title;    // 标题