|
|
@@ -158,7 +158,16 @@ namespace CallCenterApi.Interface.Controllers.report
|
|
158
|
158
|
string sql = "";
|
|
159
|
159
|
if (!string.IsNullOrEmpty(years))
|
|
160
|
160
|
{
|
|
161
|
|
- sql += $" and CONVERT(char(4),BeginTime,20) = '{years}' ";
|
|
|
161
|
+ try
|
|
|
162
|
+ {
|
|
|
163
|
+ DateTime time = DateTime.Parse(years);
|
|
|
164
|
+ sql += $" and CONVERT(char(4),BeginTime,20) = '{time.Year }' ";
|
|
|
165
|
+ }
|
|
|
166
|
+ catch
|
|
|
167
|
+ {
|
|
|
168
|
+ sql += $" and CONVERT(char(4),BeginTime,20) = '{years }' ";
|
|
|
169
|
+ }
|
|
|
170
|
+
|
|
162
|
171
|
}
|
|
163
|
172
|
DataTable dtNew = new DataTable();
|
|
164
|
173
|
#region
|
|
|
@@ -184,7 +193,16 @@ namespace CallCenterApi.Interface.Controllers.report
|
|
184
|
193
|
}
|
|
185
|
194
|
else
|
|
186
|
195
|
{
|
|
187
|
|
- dtNow = DateTime.Parse(years + "年");
|
|
|
196
|
+ try
|
|
|
197
|
+ {
|
|
|
198
|
+ DateTime time = DateTime.Parse(years);
|
|
|
199
|
+ dtNow = DateTime.Parse(time.Year + "年");
|
|
|
200
|
+ }
|
|
|
201
|
+ catch
|
|
|
202
|
+ {
|
|
|
203
|
+ dtNow = DateTime.Parse(years + "年");
|
|
|
204
|
+ }
|
|
|
205
|
+
|
|
188
|
206
|
}
|
|
189
|
207
|
int monthcount = 0;
|
|
190
|
208
|
for (int i = 1; i <= 12; i++)
|
|
|
@@ -408,8 +426,18 @@ namespace CallCenterApi.Interface.Controllers.report
|
|
408
|
426
|
}
|
|
409
|
427
|
if (!string.IsNullOrEmpty(years))
|
|
410
|
428
|
{
|
|
411
|
|
- sql += $" and CONVERT(char(4),BeginTime,20) = '{years}' ";
|
|
412
|
|
- dtNow = DateTime.Parse(years + "年");
|
|
|
429
|
+ try
|
|
|
430
|
+ {
|
|
|
431
|
+ DateTime time = DateTime.Parse(years);
|
|
|
432
|
+ sql += $" and CONVERT(char(4),BeginTime,20) = '{time.Year }' ";
|
|
|
433
|
+ dtNow = DateTime.Parse(time.Year + "年");
|
|
|
434
|
+ }
|
|
|
435
|
+ catch
|
|
|
436
|
+ {
|
|
|
437
|
+ sql += $" and CONVERT(char(4),BeginTime,20) = '{years}' ";
|
|
|
438
|
+ dtNow = DateTime.Parse(years + "年");
|
|
|
439
|
+ }
|
|
|
440
|
+
|
|
413
|
441
|
}
|
|
414
|
442
|
else
|
|
415
|
443
|
dtNow = DateTime.Now;
|