No Description

HistoryController.cs 2.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. using CallCenter.Utility;
  2. using CallCenterApi.Common;
  3. using CallCenterApi.Interface.Controllers.Base;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Data;
  7. using System.Linq;
  8. using System.Web;
  9. using System.Web.Mvc;
  10. namespace CallCenterApi.Interface.Controllers
  11. {
  12. [Authority]
  13. public class HistoryController : BaseController
  14. {
  15. /// <summary>
  16. /// 添加班组
  17. /// </summary>
  18. /// <param name="input"></param>
  19. /// <returns></returns>
  20. [HttpPost]
  21. //[Authority]
  22. public ActionResult Add()
  23. {
  24. string name = RequestString.GetFormString("name");
  25. string remark = RequestString.GetFormString("count");
  26. Model.T_Sys_History dModel = new Model.T_Sys_History();
  27. dModel.F_UserID = User.F_UserId ;
  28. dModel.F_Name = name;
  29. dModel.F_Count = remark;
  30. dModel.F_CreatTime = DateTime .Now ;
  31. int n = new BLL.T_Sys_History().Add(dModel);
  32. if (n > 0)
  33. return Success("添加成功", n);
  34. else
  35. return Error("添加失败");
  36. }
  37. public ActionResult Delete(int type=0,int id=0)
  38. {
  39. if (type ==0)
  40. {
  41. if (id >0)
  42. {
  43. bool n = new BLL.T_Sys_History().Delete(id);
  44. if (n)
  45. return Success("删除成功");
  46. else
  47. return Error("删除失败");
  48. }
  49. else
  50. {
  51. return Error("请选择正确的历史记录");
  52. }
  53. }
  54. else
  55. {
  56. bool n = new BLL.T_Sys_History().DeleteList ("select " +
  57. "F_ID from T_Sys_History where F_UserID='"+User .F_UserId +"' ");
  58. if (n)
  59. return Success("删除成功");
  60. else
  61. return Error("删除失败");
  62. }
  63. }
  64. /// <summary>
  65. /// 获取列表
  66. /// </summary>
  67. /// <returns></returns>
  68. //[Authority]
  69. public ActionResult GetList()
  70. {
  71. string name = RequestString.GetFormString("name");
  72. if (!string .IsNullOrEmpty (name))
  73. {
  74. string sql = "and F_Name='" + name + "'";
  75. }
  76. var modellist = new BLL.T_Sys_History().GetModelList ("F_UserID='"+ User.F_UserId + "'");
  77. return Success("加载成功", modellist);
  78. }
  79. }
  80. }