|
|
@@ -12,6 +12,8 @@ namespace CallCenterApi.Interface.Controllers.tel
|
|
12
|
12
|
{
|
|
13
|
13
|
public class WorkcalendarController : BaseController
|
|
14
|
14
|
{
|
|
|
15
|
+
|
|
|
16
|
+ private BLL.T_Sys_WorkTimes workTimesBLL = new BLL.T_Sys_WorkTimes();
|
|
15
|
17
|
// 获取工作日历
|
|
16
|
18
|
public ActionResult GetCalendarList(string strdate)
|
|
17
|
19
|
{
|
|
|
@@ -54,64 +56,64 @@ namespace CallCenterApi.Interface.Controllers.tel
|
|
54
|
56
|
ActionResult res = NoToken("未知错误,请重新登录");
|
|
55
|
57
|
if (Request.IsAuthenticated)
|
|
56
|
58
|
{
|
|
57
|
|
-
|
|
58
|
|
- if (date != null && date != "")
|
|
|
59
|
+
|
|
|
60
|
+ if (date != null && date != "")
|
|
|
61
|
+ {
|
|
|
62
|
+ DateTime dt = new DateTime();
|
|
|
63
|
+ if (DateTime.TryParse(date, out dt))
|
|
59
|
64
|
{
|
|
60
|
|
- DateTime dt = new DateTime();
|
|
61
|
|
- if (DateTime.TryParse(date, out dt))
|
|
|
65
|
+ Model.T_Sys_WorkCalendar wc = new BLL.T_Sys_WorkCalendar().GetModel(dt);
|
|
|
66
|
+ if (wc != null)
|
|
62
|
67
|
{
|
|
63
|
|
- Model.T_Sys_WorkCalendar wc = new BLL.T_Sys_WorkCalendar().GetModel(dt);
|
|
64
|
|
- if (wc != null)
|
|
|
68
|
+ if (wc.F_EditFlag == false) //没有修改过
|
|
65
|
69
|
{
|
|
66
|
|
- if (wc.F_EditFlag == false) //没有修改过
|
|
|
70
|
+ if (wc.F_WorkingFlag)
|
|
67
|
71
|
{
|
|
68
|
|
- if (wc.F_WorkingFlag)
|
|
69
|
|
- {
|
|
70
|
|
- wc.F_WorkingFlag = false;
|
|
71
|
|
- }
|
|
72
|
|
- else
|
|
73
|
|
- {
|
|
74
|
|
- wc.F_WorkingFlag = true;
|
|
75
|
|
- }
|
|
76
|
|
- wc.F_EditFlag = true;
|
|
|
72
|
+ wc.F_WorkingFlag = false;
|
|
77
|
73
|
}
|
|
78
|
|
- else//修改过
|
|
|
74
|
+ else
|
|
79
|
75
|
{
|
|
80
|
|
- if (wc.F_WorkingFlag)
|
|
81
|
|
- {
|
|
82
|
|
- wc.F_WorkingFlag = false;
|
|
83
|
|
- }
|
|
84
|
|
- else
|
|
85
|
|
- {
|
|
86
|
|
- wc.F_WorkingFlag = true;
|
|
87
|
|
- }
|
|
88
|
|
- wc.F_EditFlag = false;
|
|
|
76
|
+ wc.F_WorkingFlag = true;
|
|
89
|
77
|
}
|
|
90
|
|
- bool rvalue = new BLL.T_Sys_WorkCalendar().Update(wc);
|
|
91
|
|
- if (rvalue)
|
|
|
78
|
+ wc.F_EditFlag = true;
|
|
|
79
|
+ }
|
|
|
80
|
+ else//修改过
|
|
|
81
|
+ {
|
|
|
82
|
+ if (wc.F_WorkingFlag)
|
|
92
|
83
|
{
|
|
93
|
|
- res = Success("设置成功!");
|
|
|
84
|
+ wc.F_WorkingFlag = false;
|
|
94
|
85
|
}
|
|
95
|
86
|
else
|
|
96
|
87
|
{
|
|
97
|
|
- res = Error("设置失败!");
|
|
|
88
|
+ wc.F_WorkingFlag = true;
|
|
98
|
89
|
}
|
|
|
90
|
+ wc.F_EditFlag = false;
|
|
|
91
|
+ }
|
|
|
92
|
+ bool rvalue = new BLL.T_Sys_WorkCalendar().Update(wc);
|
|
|
93
|
+ if (rvalue)
|
|
|
94
|
+ {
|
|
|
95
|
+ res = Success("设置成功!");
|
|
99
|
96
|
}
|
|
100
|
97
|
else
|
|
101
|
98
|
{
|
|
102
|
|
- res = Error("获取对象失败");
|
|
|
99
|
+ res = Error("设置失败!");
|
|
103
|
100
|
}
|
|
104
|
101
|
}
|
|
105
|
102
|
else
|
|
106
|
103
|
{
|
|
107
|
|
- res = Error("日期格式不正确");
|
|
|
104
|
+ res = Error("获取对象失败");
|
|
108
|
105
|
}
|
|
109
|
106
|
}
|
|
110
|
107
|
else
|
|
111
|
108
|
{
|
|
112
|
|
- res = Error("获取参数失败");
|
|
|
109
|
+ res = Error("日期格式不正确");
|
|
113
|
110
|
}
|
|
114
|
|
-
|
|
|
111
|
+ }
|
|
|
112
|
+ else
|
|
|
113
|
+ {
|
|
|
114
|
+ res = Error("获取参数失败");
|
|
|
115
|
+ }
|
|
|
116
|
+
|
|
115
|
117
|
}
|
|
116
|
118
|
return res;
|
|
117
|
119
|
}
|
|
|
@@ -124,51 +126,55 @@ namespace CallCenterApi.Interface.Controllers.tel
|
|
124
|
126
|
{
|
|
125
|
127
|
string sql = "";
|
|
126
|
128
|
DataTable dt = new DataTable();
|
|
127
|
|
-
|
|
128
|
129
|
|
|
129
|
|
- string keyword = HttpUtility.UrlDecode(RequestString.GetQueryString("keyword"));
|
|
130
|
|
- if (keyword.Trim() != "" && keyword != "undefined")
|
|
131
|
|
- {
|
|
132
|
|
- sql += " and (convert(varchar,F_WorkEndTimes,120) like '%" + keyword.Trim() + "%' or convert(varchar,F_WorkEndTimes,120) like '%" + keyword.Trim()
|
|
133
|
|
- + "%' or F_TimeName like '%" + keyword.Trim() + "%'or F_Remark like '%" + keyword.Trim() + "%')";
|
|
134
|
|
- }
|
|
135
|
130
|
|
|
136
|
|
- string strpageindex = RequestString.GetQueryString("page");
|
|
137
|
|
- int pageindex = 1;
|
|
138
|
|
- string strpagesize = RequestString.GetQueryString("pagesize");
|
|
139
|
|
- int pagesize = 10;
|
|
|
131
|
+ string keyword = HttpUtility.UrlDecode(RequestString.GetQueryString("keyword"));
|
|
|
132
|
+ if (keyword.Trim() != "" && keyword != "undefined")
|
|
|
133
|
+ {
|
|
|
134
|
+ sql += " and (convert(varchar,F_WorkEndTimes,120) like '%" + keyword.Trim() + "%' or convert(varchar,F_WorkEndTimes,120) like '%" + keyword.Trim()
|
|
|
135
|
+ + "%' or F_TimeName like '%" + keyword.Trim() + "%'or F_Remark like '%" + keyword.Trim() + "%')";
|
|
|
136
|
+ }
|
|
140
|
137
|
|
|
141
|
|
- if (strpageindex.Trim() != "")
|
|
142
|
|
- {
|
|
143
|
|
- pageindex = Convert.ToInt32(strpageindex);
|
|
144
|
|
- }
|
|
|
138
|
+ var deptId = CurrentUser.UserData.F_DeptId;
|
|
|
139
|
+ sql += $" and F_DeptId={deptId} ";
|
|
145
|
140
|
|
|
146
|
|
- if (strpagesize.Trim() != "")
|
|
147
|
|
- {
|
|
148
|
|
- pagesize = Convert.ToInt32(strpagesize);
|
|
149
|
|
- }
|
|
150
|
|
- int recordCount = 0;
|
|
151
|
|
- dt = BLL.PagerBLL.GetListPager(
|
|
152
|
|
- "T_Sys_WorkTimes",
|
|
153
|
|
- "F_ID",
|
|
154
|
|
- "*",
|
|
155
|
|
- sql,
|
|
156
|
|
- "ORDER BY F_ID desc",
|
|
157
|
|
- pagesize,
|
|
158
|
|
- pageindex,
|
|
159
|
|
- true,
|
|
160
|
|
- out recordCount);
|
|
161
|
141
|
|
|
162
|
|
- var obj = new
|
|
163
|
|
- {
|
|
164
|
|
- state = "success",
|
|
165
|
|
- message = "成功",
|
|
166
|
|
- rows = dt,
|
|
167
|
|
- total = recordCount
|
|
168
|
|
- };
|
|
|
142
|
+ string strpageindex = RequestString.GetQueryString("page");
|
|
|
143
|
+ int pageindex = 1;
|
|
|
144
|
+ string strpagesize = RequestString.GetQueryString("pagesize");
|
|
|
145
|
+ int pagesize = 10;
|
|
|
146
|
+
|
|
|
147
|
+ if (strpageindex.Trim() != "")
|
|
|
148
|
+ {
|
|
|
149
|
+ pageindex = Convert.ToInt32(strpageindex);
|
|
|
150
|
+ }
|
|
|
151
|
+
|
|
|
152
|
+ if (strpagesize.Trim() != "")
|
|
|
153
|
+ {
|
|
|
154
|
+ pagesize = Convert.ToInt32(strpagesize);
|
|
|
155
|
+ }
|
|
|
156
|
+ int recordCount = 0;
|
|
|
157
|
+ dt = BLL.PagerBLL.GetListPager(
|
|
|
158
|
+ "T_Sys_WorkTimes",
|
|
|
159
|
+ "F_ID",
|
|
|
160
|
+ "*",
|
|
|
161
|
+ sql,
|
|
|
162
|
+ "ORDER BY F_ID desc",
|
|
|
163
|
+ pagesize,
|
|
|
164
|
+ pageindex,
|
|
|
165
|
+ true,
|
|
|
166
|
+ out recordCount);
|
|
|
167
|
+
|
|
|
168
|
+ var obj = new
|
|
|
169
|
+ {
|
|
|
170
|
+ state = "success",
|
|
|
171
|
+ message = "成功",
|
|
|
172
|
+ rows = dt,
|
|
|
173
|
+ total = recordCount
|
|
|
174
|
+ };
|
|
|
175
|
+
|
|
|
176
|
+ res = Content(obj.ToJson());
|
|
169
|
177
|
|
|
170
|
|
- res = Content(obj.ToJson());
|
|
171
|
|
-
|
|
172
|
178
|
}
|
|
173
|
179
|
return res;
|
|
174
|
180
|
}
|
|
|
@@ -179,26 +185,26 @@ namespace CallCenterApi.Interface.Controllers.tel
|
|
179
|
185
|
ActionResult res = NoToken("未知错误,请重新登录");
|
|
180
|
186
|
if (Request.IsAuthenticated)
|
|
181
|
187
|
{
|
|
182
|
|
-
|
|
183
|
|
- if (id != null && id.Trim() != "")
|
|
|
188
|
+
|
|
|
189
|
+ if (id != null && id.Trim() != "")
|
|
|
190
|
+ {
|
|
|
191
|
+ BLL.T_Sys_WorkTimes dBLL = new BLL.T_Sys_WorkTimes();
|
|
|
192
|
+ Model.T_Sys_WorkTimes dModel = dBLL.GetModel(int.Parse(id.Trim()));
|
|
|
193
|
+ if (dModel != null)
|
|
184
|
194
|
{
|
|
185
|
|
- BLL.T_Sys_WorkTimes dBLL = new BLL.T_Sys_WorkTimes();
|
|
186
|
|
- Model.T_Sys_WorkTimes dModel = dBLL.GetModel(int.Parse(id.Trim()));
|
|
187
|
|
- if (dModel != null)
|
|
188
|
|
- {
|
|
189
|
|
- res = Success("获取成功", dModel);
|
|
190
|
|
- }
|
|
191
|
|
- else
|
|
192
|
|
- {
|
|
193
|
|
- res = Error("获取失败");
|
|
194
|
|
- }
|
|
|
195
|
+ res = Success("获取成功", dModel);
|
|
195
|
196
|
}
|
|
196
|
197
|
else
|
|
197
|
198
|
{
|
|
198
|
|
- res = Error("获取参数失败");
|
|
|
199
|
+ res = Error("获取失败");
|
|
199
|
200
|
}
|
|
200
|
|
-
|
|
201
|
|
-
|
|
|
201
|
+ }
|
|
|
202
|
+ else
|
|
|
203
|
+ {
|
|
|
204
|
+ res = Error("获取参数失败");
|
|
|
205
|
+ }
|
|
|
206
|
+
|
|
|
207
|
+
|
|
202
|
208
|
}
|
|
203
|
209
|
return res;
|
|
204
|
210
|
}
|
|
|
@@ -209,97 +215,94 @@ namespace CallCenterApi.Interface.Controllers.tel
|
|
209
|
215
|
ActionResult res = NoToken("未知错误,请重新登录");
|
|
210
|
216
|
if (Request.IsAuthenticated)
|
|
211
|
217
|
{
|
|
212
|
|
-
|
|
213
|
|
- int userId = CurrentUser.UserData.F_UserId;
|
|
214
|
|
- if (userId != 0)
|
|
|
218
|
+
|
|
|
219
|
+ int userId = CurrentUser.UserData.F_UserId;
|
|
|
220
|
+ if (userId != 0)
|
|
|
221
|
+ {
|
|
|
222
|
+ Model.T_Sys_UserAccount ua = new BLL.T_Sys_UserAccount().GetModel(userId);
|
|
|
223
|
+ if (ua != null)
|
|
215
|
224
|
{
|
|
216
|
|
- Model.T_Sys_UserAccount ua = new BLL.T_Sys_UserAccount().GetModel(userId);
|
|
217
|
|
- if (ua != null)
|
|
|
225
|
+ res = Error("操作失败");
|
|
|
226
|
+ if (workid != null && workid != "")
|
|
218
|
227
|
{
|
|
219
|
|
- res=Error("操作失败");
|
|
220
|
|
- if (workid != null && workid != "")
|
|
|
228
|
+ int id = 0;
|
|
|
229
|
+ if (int.TryParse(workid, out id))
|
|
221
|
230
|
{
|
|
222
|
|
- int id = 0;
|
|
223
|
|
- if (int.TryParse(workid, out id))
|
|
|
231
|
+ BLL.T_Sys_WorkTimes dBLL = new BLL.T_Sys_WorkTimes();
|
|
|
232
|
+ Model.T_Sys_WorkTimes dModel = dBLL.GetModel(id);
|
|
|
233
|
+ if (dModel != null)
|
|
224
|
234
|
{
|
|
225
|
|
- BLL.T_Sys_WorkTimes dBLL = new BLL.T_Sys_WorkTimes();
|
|
226
|
|
- Model.T_Sys_WorkTimes dModel = dBLL.GetModel(id);
|
|
227
|
|
- if (dModel != null)
|
|
|
235
|
+ if (!string.IsNullOrWhiteSpace(workstart.Trim()))
|
|
|
236
|
+ {
|
|
|
237
|
+ DateTime dt1 = new DateTime();
|
|
|
238
|
+ if (DateTime.TryParse(workstart.Trim(), out dt1))
|
|
|
239
|
+ dModel.F_WorkStartTimes = Convert.ToDateTime(dt1.ToString("1900-01-01 HH:mm:ss"));
|
|
|
240
|
+ }
|
|
|
241
|
+ if (!string.IsNullOrWhiteSpace(workend.Trim()))
|
|
|
242
|
+ {
|
|
|
243
|
+ DateTime dt1 = new DateTime();
|
|
|
244
|
+ if (DateTime.TryParse(workend.Trim(), out dt1))
|
|
|
245
|
+ dModel.F_WorkEndTimes = Convert.ToDateTime(dt1.ToString("1900-01-01 HH:mm:ss"));
|
|
|
246
|
+ }
|
|
|
247
|
+ if (!string.IsNullOrWhiteSpace(timename.Trim()))
|
|
|
248
|
+ {
|
|
|
249
|
+ dModel.F_TimeName = timename.Trim();
|
|
|
250
|
+ }
|
|
|
251
|
+ if (!string.IsNullOrWhiteSpace(remark.Trim()))
|
|
228
|
252
|
{
|
|
229
|
|
- if (!string.IsNullOrWhiteSpace(workstart.Trim()))
|
|
230
|
|
- {
|
|
231
|
|
- DateTime dt1 = new DateTime();
|
|
232
|
|
- if (DateTime.TryParse(workstart.Trim(), out dt1))
|
|
233
|
|
- dModel.F_WorkStartTimes = Convert.ToDateTime(dt1.ToString("1900-01-01 HH:mm:ss"));
|
|
234
|
|
- }
|
|
235
|
|
- if (!string.IsNullOrWhiteSpace(workend.Trim()))
|
|
236
|
|
- {
|
|
237
|
|
- DateTime dt1 = new DateTime();
|
|
238
|
|
- if (DateTime.TryParse(workend.Trim(), out dt1))
|
|
239
|
|
- dModel.F_WorkEndTimes = Convert.ToDateTime(dt1.ToString("1900-01-01 HH:mm:ss"));
|
|
240
|
|
- }
|
|
241
|
|
- if (!string.IsNullOrWhiteSpace(timename.Trim()))
|
|
242
|
|
- {
|
|
243
|
|
- dModel.F_TimeName = timename.Trim();
|
|
244
|
|
- }
|
|
245
|
|
- if (!string.IsNullOrWhiteSpace(remark.Trim()))
|
|
246
|
|
- {
|
|
247
|
|
- dModel.F_Remark = remark.Trim();
|
|
248
|
|
- }
|
|
|
253
|
+ dModel.F_Remark = remark.Trim();
|
|
|
254
|
+ }
|
|
249
|
255
|
|
|
250
|
|
- bool b = dBLL.Update(dModel);
|
|
251
|
|
- if (b)
|
|
252
|
|
- {
|
|
253
|
|
- res = Success("编辑成功");
|
|
254
|
|
- }
|
|
255
|
|
- else
|
|
256
|
|
- {
|
|
257
|
|
- res = Error("编辑失败");
|
|
258
|
|
- }
|
|
|
256
|
+ bool b = dBLL.Update(dModel);
|
|
|
257
|
+ if (b)
|
|
|
258
|
+ {
|
|
|
259
|
+ res = Success("编辑成功");
|
|
|
260
|
+ }
|
|
|
261
|
+ else
|
|
|
262
|
+ {
|
|
|
263
|
+ res = Error("编辑失败");
|
|
259
|
264
|
}
|
|
260
|
265
|
}
|
|
261
|
266
|
}
|
|
262
|
|
- else
|
|
|
267
|
+ }
|
|
|
268
|
+ else
|
|
|
269
|
+ {
|
|
|
270
|
+ Model.T_Sys_WorkTimes _model = new Model.T_Sys_WorkTimes();
|
|
|
271
|
+ if (!string.IsNullOrWhiteSpace(workstart.Trim()))
|
|
263
|
272
|
{
|
|
264
|
|
- Model.T_Sys_WorkTimes _model = new Model.T_Sys_WorkTimes();
|
|
265
|
|
- if (!string.IsNullOrWhiteSpace(workstart.Trim()))
|
|
266
|
|
- {
|
|
267
|
|
- DateTime dt2 = new DateTime();
|
|
268
|
|
- if (DateTime.TryParse("1900-01-01 " + workstart.Trim(), out dt2))
|
|
269
|
|
- _model.F_WorkStartTimes = Convert.ToDateTime(dt2.ToString("1900-01-01 HH:mm:ss"));
|
|
270
|
|
- }
|
|
271
|
|
- if (!string.IsNullOrWhiteSpace(workend.Trim()))
|
|
272
|
|
- {
|
|
273
|
|
- DateTime dt2 = new DateTime();
|
|
274
|
|
- if (DateTime.TryParse("1900-01-01 " + workend.Trim(), out dt2))
|
|
275
|
|
- _model.F_WorkEndTimes = Convert.ToDateTime(dt2.ToString("1900-01-01 HH:mm:ss"));
|
|
276
|
|
- }
|
|
277
|
|
- if (!string.IsNullOrWhiteSpace(timename.Trim()))
|
|
278
|
|
- {
|
|
279
|
|
- _model.F_TimeName = timename.Trim();
|
|
280
|
|
- }
|
|
281
|
|
- if (!string.IsNullOrWhiteSpace(remark.Trim()))
|
|
282
|
|
- {
|
|
283
|
|
- _model.F_Remark = remark.Trim();
|
|
284
|
|
- }
|
|
285
|
|
- _model.F_CreateOn = DateTime.Now;
|
|
286
|
|
- _model.F_UserID = ua.F_UserId;
|
|
287
|
|
- _model.F_UserName = ua.F_UserName;
|
|
288
|
|
- _model.F_UserCode = ua.F_UserCode;
|
|
|
273
|
+ DateTime dt2 = new DateTime();
|
|
|
274
|
+ if (DateTime.TryParse("1900-01-01 " + workstart.Trim(), out dt2))
|
|
|
275
|
+ _model.F_WorkStartTimes = Convert.ToDateTime(dt2.ToString("1900-01-01 HH:mm:ss"));
|
|
|
276
|
+ }
|
|
|
277
|
+ if (!string.IsNullOrWhiteSpace(workend.Trim()))
|
|
|
278
|
+ {
|
|
|
279
|
+ DateTime dt2 = new DateTime();
|
|
|
280
|
+ if (DateTime.TryParse("1900-01-01 " + workend.Trim(), out dt2))
|
|
|
281
|
+ _model.F_WorkEndTimes = Convert.ToDateTime(dt2.ToString("1900-01-01 HH:mm:ss"));
|
|
|
282
|
+ }
|
|
|
283
|
+ if (!string.IsNullOrWhiteSpace(timename.Trim()))
|
|
|
284
|
+ {
|
|
|
285
|
+ _model.F_TimeName = timename.Trim();
|
|
|
286
|
+ }
|
|
|
287
|
+ if (!string.IsNullOrWhiteSpace(remark.Trim()))
|
|
|
288
|
+ {
|
|
|
289
|
+ _model.F_Remark = remark.Trim();
|
|
|
290
|
+ }
|
|
|
291
|
+ _model.F_DeptId = CurrentUser.UserData.F_DeptId;
|
|
289
|
292
|
|
|
290
|
|
- int b = new BLL.T_Sys_WorkTimes().Add(_model);
|
|
291
|
|
- if (b > 0)
|
|
292
|
|
- {
|
|
293
|
|
- res = Success("添加成功");
|
|
294
|
|
- }
|
|
295
|
|
- else
|
|
296
|
|
- {
|
|
297
|
|
- res = Error("添加失败");
|
|
298
|
|
- }
|
|
|
293
|
+ int b = new BLL.T_Sys_WorkTimes().Add(_model);
|
|
|
294
|
+ if (b > 0)
|
|
|
295
|
+ {
|
|
|
296
|
+ res = Success("添加成功");
|
|
|
297
|
+ }
|
|
|
298
|
+ else
|
|
|
299
|
+ {
|
|
|
300
|
+ res = Error("添加失败");
|
|
299
|
301
|
}
|
|
300
|
302
|
}
|
|
301
|
303
|
}
|
|
302
|
|
-
|
|
|
304
|
+ }
|
|
|
305
|
+
|
|
303
|
306
|
}
|
|
304
|
307
|
return res;
|
|
305
|
308
|
}
|
|
|
@@ -310,28 +313,54 @@ namespace CallCenterApi.Interface.Controllers.tel
|
|
310
|
313
|
ActionResult res = NoToken("未知错误,请重新登录");
|
|
311
|
314
|
if (Request.IsAuthenticated)
|
|
312
|
315
|
{
|
|
313
|
|
-
|
|
314
|
|
- if (ids != null && ids.Length > 0)
|
|
|
316
|
+
|
|
|
317
|
+ if (ids != null && ids.Length > 0)
|
|
|
318
|
+ {
|
|
|
319
|
+ string idd = " ";
|
|
|
320
|
+ foreach (string str in ids)
|
|
315
|
321
|
{
|
|
316
|
|
- string idd = " ";
|
|
317
|
|
- foreach (string str in ids)
|
|
318
|
|
- {
|
|
319
|
|
- idd += "'" + str + "',";
|
|
320
|
|
- }
|
|
321
|
|
- if (new BLL.T_Sys_WorkTimes().DeleteList(idd.TrimEnd(',')))
|
|
322
|
|
- {
|
|
323
|
|
- res = Success("删除成功");
|
|
324
|
|
- }
|
|
325
|
|
- else
|
|
326
|
|
- res = Error("删除失败");
|
|
|
322
|
+ idd += "'" + str + "',";
|
|
327
|
323
|
}
|
|
328
|
|
- else
|
|
|
324
|
+ if (new BLL.T_Sys_WorkTimes().DeleteList(idd.TrimEnd(',')))
|
|
329
|
325
|
{
|
|
330
|
|
- res = Error("请选择要删除的记录");
|
|
|
326
|
+ res = Success("删除成功");
|
|
331
|
327
|
}
|
|
332
|
|
-
|
|
|
328
|
+ else
|
|
|
329
|
+ res = Error("删除失败");
|
|
|
330
|
+ }
|
|
|
331
|
+ else
|
|
|
332
|
+ {
|
|
|
333
|
+ res = Error("请选择要删除的记录");
|
|
|
334
|
+ }
|
|
|
335
|
+
|
|
333
|
336
|
}
|
|
334
|
337
|
return res;
|
|
335
|
338
|
}
|
|
|
339
|
+
|
|
|
340
|
+ [Authority]
|
|
|
341
|
+ public ActionResult GetIsOnDutyTime()
|
|
|
342
|
+ {
|
|
|
343
|
+ var deptId = CurrentUser.UserData.F_DeptId;
|
|
|
344
|
+ var list = workTimesBLL.DataTableToList(workTimesBLL.GetList($" F_DeptId={deptId} ").Tables[0]);
|
|
|
345
|
+ var isOnDutyTime = false;
|
|
|
346
|
+ var now = DateTime.Now.TimeOfDay;
|
|
|
347
|
+ foreach (var item in list)
|
|
|
348
|
+ {
|
|
|
349
|
+ var start = item.F_WorkStartTimes == null ? DateTime.MinValue : Convert.ToDateTime(item.F_WorkStartTimes);
|
|
|
350
|
+ var end = item.F_WorkEndTimes == null ? DateTime.MinValue : Convert.ToDateTime(item.F_WorkEndTimes);
|
|
|
351
|
+
|
|
|
352
|
+ var startTime = start.TimeOfDay;
|
|
|
353
|
+ var endTime = end.TimeOfDay;
|
|
|
354
|
+ if (now > startTime && now < endTime)
|
|
|
355
|
+ {
|
|
|
356
|
+ isOnDutyTime = true;
|
|
|
357
|
+ break;
|
|
|
358
|
+ }
|
|
|
359
|
+ continue;
|
|
|
360
|
+ }
|
|
|
361
|
+ if (isOnDutyTime)
|
|
|
362
|
+ return Success("");
|
|
|
363
|
+ return Error("未在正常上班时间,无法拨出电话");
|
|
|
364
|
+ }
|
|
336
|
365
|
}
|
|
337
|
366
|
}
|