|
|
@@ -318,7 +318,232 @@ namespace CallCenterApi.DAL
|
|
318
|
318
|
}
|
|
319
|
319
|
|
|
320
|
320
|
|
|
|
321
|
+ #region 日程提醒相关
|
|
|
322
|
+ /// <summary>
|
|
|
323
|
+ /// 增加一条数据
|
|
|
324
|
+ /// </summary>
|
|
|
325
|
+ public bool AddSR(Model.T_Sys_WorkCalendar model)
|
|
|
326
|
+ {
|
|
|
327
|
+ StringBuilder strSql = new StringBuilder();
|
|
|
328
|
+ strSql.Append("insert into T_Sys_ScheduleReminder(");
|
|
|
329
|
+ strSql.Append("F_Date,F_Content,F_CreateUser,F_CreateTime,F_IsRead)");
|
|
|
330
|
+ strSql.Append(" values (");
|
|
|
331
|
+ strSql.Append("@F_Date,@F_Content,@F_CreateUser,@F_CreateTime,@F_IsRead)");
|
|
|
332
|
+ SqlParameter[] parameters = {
|
|
|
333
|
+ new SqlParameter("@F_Date", SqlDbType.DateTime),
|
|
|
334
|
+ new SqlParameter("@F_Content", SqlDbType.NVarChar,100),
|
|
|
335
|
+ new SqlParameter("@F_CreateUser", SqlDbType.NVarChar,50),
|
|
|
336
|
+ new SqlParameter("@F_CreateTime", SqlDbType.DateTime),
|
|
|
337
|
+ new SqlParameter("@F_IsRead", SqlDbType.Bit,1)};
|
|
|
338
|
+ parameters[0].Value = model.F_Date;
|
|
|
339
|
+ parameters[1].Value = model.F_Content;
|
|
|
340
|
+ parameters[2].Value = model.F_CreateUser;
|
|
|
341
|
+ parameters[3].Value = model.F_CreateTime;
|
|
|
342
|
+ parameters[4].Value = model.F_IsRead;
|
|
|
343
|
+
|
|
|
344
|
+
|
|
|
345
|
+ int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
|
|
|
346
|
+ if (rows > 0)
|
|
|
347
|
+ {
|
|
|
348
|
+ return true;
|
|
|
349
|
+ }
|
|
|
350
|
+ else
|
|
|
351
|
+ {
|
|
|
352
|
+ return false;
|
|
|
353
|
+ }
|
|
|
354
|
+ }
|
|
|
355
|
+ /// <summary>
|
|
|
356
|
+ /// 更新一条数据
|
|
|
357
|
+ /// </summary>
|
|
|
358
|
+ public bool UpdateSR(Model.T_Sys_WorkCalendar model)
|
|
|
359
|
+ {
|
|
|
360
|
+ StringBuilder strSql = new StringBuilder();
|
|
|
361
|
+ strSql.Append("update T_Sys_ScheduleReminder set ");
|
|
|
362
|
+ strSql.Append("F_Date=@F_Date,");
|
|
|
363
|
+ strSql.Append("F_Content=@F_Content,");
|
|
|
364
|
+ strSql.Append("F_CreateUser=@F_CreateUser,");
|
|
|
365
|
+ strSql.Append("F_CreateTime=@F_CreateTime,");
|
|
|
366
|
+ strSql.Append("F_IsRead=@F_IsRead");
|
|
|
367
|
+ strSql.Append(" where F_ID=@F_ID ");
|
|
|
368
|
+ SqlParameter[] parameters = {
|
|
|
369
|
+ new SqlParameter("@F_Date", SqlDbType.DateTime),
|
|
|
370
|
+ new SqlParameter("@F_Content", SqlDbType.NVarChar,100),
|
|
|
371
|
+ new SqlParameter("@F_CreateUser", SqlDbType.NVarChar,50),
|
|
|
372
|
+ new SqlParameter("@F_CreateTime", SqlDbType.DateTime),
|
|
|
373
|
+ new SqlParameter("@F_IsRead", SqlDbType.Bit,1),
|
|
|
374
|
+ new SqlParameter("@F_ID", SqlDbType.Int )};
|
|
|
375
|
+ parameters[0].Value = model.F_Date;
|
|
|
376
|
+ parameters[1].Value = model.F_Content;
|
|
|
377
|
+ parameters[2].Value = model.F_CreateUser;
|
|
|
378
|
+ parameters[3].Value = model.F_CreateTime;
|
|
|
379
|
+ parameters[4].Value = model.F_IsRead;
|
|
|
380
|
+ parameters[5].Value = model.F_ID;
|
|
321
|
381
|
|
|
|
382
|
+ int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
|
|
|
383
|
+ if (rows > 0)
|
|
|
384
|
+ {
|
|
|
385
|
+ return true;
|
|
|
386
|
+ }
|
|
|
387
|
+ else
|
|
|
388
|
+ {
|
|
|
389
|
+ return false;
|
|
|
390
|
+ }
|
|
|
391
|
+ }
|
|
|
392
|
+
|
|
|
393
|
+ /// <summary>
|
|
|
394
|
+ /// 删除一条数据
|
|
|
395
|
+ /// </summary>
|
|
|
396
|
+ public bool DeleteSR(int F_ID)
|
|
|
397
|
+ {
|
|
|
398
|
+
|
|
|
399
|
+ StringBuilder strSql = new StringBuilder();
|
|
|
400
|
+ strSql.Append("delete from T_Sys_ScheduleReminder ");
|
|
|
401
|
+ strSql.Append(" where F_ID=@F_ID ");
|
|
|
402
|
+ SqlParameter[] parameters = {
|
|
|
403
|
+ new SqlParameter("@F_ID", SqlDbType.Int) };
|
|
|
404
|
+ parameters[0].Value = F_ID;
|
|
|
405
|
+
|
|
|
406
|
+ int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
|
|
|
407
|
+ if (rows > 0)
|
|
|
408
|
+ {
|
|
|
409
|
+ return true;
|
|
|
410
|
+ }
|
|
|
411
|
+ else
|
|
|
412
|
+ {
|
|
|
413
|
+ return false;
|
|
|
414
|
+ }
|
|
|
415
|
+ }
|
|
|
416
|
+
|
|
|
417
|
+ /// <summary>
|
|
|
418
|
+ /// 得到一个对象实体
|
|
|
419
|
+ /// </summary>
|
|
|
420
|
+ public Model.T_Sys_WorkCalendar GetSRModel(int F_ID)
|
|
|
421
|
+ {
|
|
|
422
|
+
|
|
|
423
|
+ StringBuilder strSql = new StringBuilder();
|
|
|
424
|
+ strSql.Append("select top 1 F_ID,F_Date,F_Content,F_CreateUser,F_CreateTime,F_IsRead from T_Sys_ScheduleReminder ");
|
|
|
425
|
+ strSql.Append(" where F_ID=@F_ID ");
|
|
|
426
|
+ SqlParameter[] parameters = {
|
|
|
427
|
+ new SqlParameter("@F_ID", SqlDbType.Int ) };
|
|
|
428
|
+ parameters[0].Value = F_ID;
|
|
|
429
|
+
|
|
|
430
|
+ Model.T_Sys_WorkCalendar model = new Model.T_Sys_WorkCalendar();
|
|
|
431
|
+ DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
|
|
|
432
|
+ if (ds.Tables[0].Rows.Count > 0)
|
|
|
433
|
+ {
|
|
|
434
|
+ return DataRowToModelSR(ds.Tables[0].Rows[0]);
|
|
|
435
|
+ }
|
|
|
436
|
+ else
|
|
|
437
|
+ {
|
|
|
438
|
+ return null;
|
|
|
439
|
+ }
|
|
|
440
|
+ }
|
|
|
441
|
+
|
|
|
442
|
+ /// <summary>
|
|
|
443
|
+ /// 得到一个对象实体
|
|
|
444
|
+ /// </summary>
|
|
|
445
|
+ public Model.T_Sys_WorkCalendar DataRowToModelSR(DataRow row)
|
|
|
446
|
+ {
|
|
|
447
|
+ Model.T_Sys_WorkCalendar model = new Model.T_Sys_WorkCalendar();
|
|
|
448
|
+ if (row != null)
|
|
|
449
|
+ {
|
|
|
450
|
+ if (row["F_ID"] != null && row["F_ID"].ToString() != "")
|
|
|
451
|
+ {
|
|
|
452
|
+ model.F_ID = int.Parse(row["F_ID"].ToString());
|
|
|
453
|
+ }
|
|
|
454
|
+ if (row["F_IsRead"] != null && row["F_IsRead"].ToString() != "")
|
|
|
455
|
+ {
|
|
|
456
|
+ if ((row["F_IsRead"].ToString() == "1") || (row["F_IsRead"].ToString().ToLower() == "true"))
|
|
|
457
|
+ {
|
|
|
458
|
+ model.F_IsRead = true;
|
|
|
459
|
+ }
|
|
|
460
|
+ else
|
|
|
461
|
+ {
|
|
|
462
|
+ model.F_IsRead = false;
|
|
|
463
|
+ }
|
|
|
464
|
+ }
|
|
|
465
|
+ if (row["F_Date"] != null && row["F_Date"].ToString() != "")
|
|
|
466
|
+ {
|
|
|
467
|
+ model.F_Date = DateTime.Parse(row["F_Date"].ToString());
|
|
|
468
|
+ }
|
|
|
469
|
+ if (row["F_Content"] != null)
|
|
|
470
|
+ {
|
|
|
471
|
+ model.F_Content = row["F_Content"].ToString();
|
|
|
472
|
+ }
|
|
|
473
|
+ if (row["F_CreateUser"] != null)
|
|
|
474
|
+ {
|
|
|
475
|
+ model.F_CreateUser = row["F_CreateUser"].ToString();
|
|
|
476
|
+ }
|
|
|
477
|
+ if (row["F_CreateTime"] != null && row["F_CreateTime"].ToString() != "")
|
|
|
478
|
+ {
|
|
|
479
|
+ model.F_CreateTime = DateTime.Parse(row["F_CreateTime"].ToString());
|
|
|
480
|
+ }
|
|
|
481
|
+ }
|
|
|
482
|
+ return model;
|
|
|
483
|
+ }
|
|
|
484
|
+
|
|
|
485
|
+ /// <summary>
|
|
|
486
|
+ /// 批量删除数据
|
|
|
487
|
+ /// </summary>
|
|
|
488
|
+ public bool DeleteSRList(string F_Idlist)
|
|
|
489
|
+ {
|
|
|
490
|
+ StringBuilder strSql = new StringBuilder();
|
|
|
491
|
+ strSql.Append("delete from T_Sys_ScheduleReminder ");
|
|
|
492
|
+ strSql.Append(" where F_ID in (" + F_Idlist + ") ");
|
|
|
493
|
+ int rows = DbHelperSQL.ExecuteSql(strSql.ToString());
|
|
|
494
|
+ if (rows > 0)
|
|
|
495
|
+ {
|
|
|
496
|
+ return true;
|
|
|
497
|
+ }
|
|
|
498
|
+ else
|
|
|
499
|
+ {
|
|
|
500
|
+ return false;
|
|
|
501
|
+ }
|
|
|
502
|
+ }
|
|
|
503
|
+
|
|
|
504
|
+
|
|
|
505
|
+ /// <summary>
|
|
|
506
|
+ /// 更新一条数据
|
|
|
507
|
+ /// </summary>
|
|
|
508
|
+ public bool UpdateFlag(Model.T_Sys_WorkCalendar model)
|
|
|
509
|
+ {
|
|
|
510
|
+ StringBuilder strSql = new StringBuilder();
|
|
|
511
|
+ strSql.Append("update T_Sys_ScheduleReminder set ");
|
|
|
512
|
+ strSql.Append("F_IsRead=@F_IsRead");
|
|
|
513
|
+ strSql.Append(" where F_ID=@F_ID ");
|
|
|
514
|
+ SqlParameter[] parameters = {
|
|
|
515
|
+ new SqlParameter("@F_IsRead", SqlDbType.Bit,1),
|
|
|
516
|
+ new SqlParameter("@F_ID", SqlDbType.Int )};
|
|
|
517
|
+
|
|
|
518
|
+ parameters[0].Value = model.F_IsRead;
|
|
|
519
|
+ parameters[1].Value = model.F_ID;
|
|
|
520
|
+
|
|
|
521
|
+ int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
|
|
|
522
|
+ if (rows > 0)
|
|
|
523
|
+ {
|
|
|
524
|
+ return true;
|
|
|
525
|
+ }
|
|
|
526
|
+ else
|
|
|
527
|
+ {
|
|
|
528
|
+ return false;
|
|
|
529
|
+ }
|
|
|
530
|
+ }
|
|
|
531
|
+
|
|
|
532
|
+ /// <summary>
|
|
|
533
|
+ /// 获得数据列表
|
|
|
534
|
+ /// </summary>
|
|
|
535
|
+ public DataSet GetSRList(string strWhere)
|
|
|
536
|
+ {
|
|
|
537
|
+ StringBuilder strSql = new StringBuilder();
|
|
|
538
|
+ strSql.Append("select F_ID,F_Date,F_Content,F_CreateUser,F_CreateTime,F_IsRead ");
|
|
|
539
|
+ strSql.Append(" FROM T_Sys_ScheduleReminder ");
|
|
|
540
|
+ if (strWhere.Trim() != "")
|
|
|
541
|
+ {
|
|
|
542
|
+ strSql.Append(" where " + strWhere);
|
|
|
543
|
+ }
|
|
|
544
|
+ return DbHelperSQL.Query(strSql.ToString());
|
|
|
545
|
+ }
|
|
|
546
|
+ #endregion
|
|
322
|
547
|
#endregion BasicMethod
|
|
323
|
548
|
#region ExtensionMethod
|
|
324
|
549
|
|