地铁二期项目正式开始

LogActionController.cs 2.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. using Newtonsoft.Json;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Data;
  5. using System.IO;
  6. using System.Linq;
  7. using System.Web;
  8. using System.Web.Mvc;
  9. using YTSoft.BaseCallCenter.Model;
  10. using YTSoft.BaseCallCenter.MVCWeb.Models;
  11. /// <summary>
  12. /// 客服快捷回复
  13. /// </summary>
  14. namespace YTSoft.BaseCallCenter.MVCWeb.Controllers
  15. {
  16. public class LogActionController : BaseController
  17. {
  18. BLL.T_Com_LogAction busLogAction = new BLL.T_Com_LogAction();
  19. #region 纯视图
  20. /// <summary>
  21. /// 回复列表
  22. /// </summary>
  23. /// <returns></returns>
  24. public ActionResult GetList()
  25. {
  26. return View();
  27. }
  28. #endregion
  29. [ActionName("GetListData")]
  30. public string GetListData(string Table = "", string id = "", int page = 0, int limit = 20)
  31. {
  32. string strWhere = "";
  33. if (Table == "kf_quick_msgs")
  34. {
  35. strWhere = " 1=1 ";
  36. }
  37. else
  38. {
  39. strWhere += " ContentNew='操作记录' ";
  40. }
  41. if (!string.IsNullOrEmpty(Table))
  42. {
  43. strWhere += string.Format(" and TableName = '{0}'", Table);
  44. }
  45. if (!string.IsNullOrEmpty(id))
  46. {
  47. strWhere += string.Format(" and TableId ='{0}'", id);
  48. }
  49. DataTable dt = busLogAction.GetListByPage(strWhere, " atime desc ", (page - 1) * limit, limit).Tables[0];
  50. int count = busLogAction.GetRecordCount(strWhere);
  51. return Success("成功", dt, count);
  52. }
  53. [ActionName("GetData")]
  54. public string GettData(string id)
  55. {
  56. if (string.IsNullOrEmpty(id))
  57. return Error("请输入ID");
  58. Model.T_Com_LogAction model = busLogAction.GetModel(id);
  59. return Success("成功", model, 1);
  60. }
  61. [ActionName("deletedata")]
  62. public string DeleteData(string id)
  63. {
  64. if (string.IsNullOrEmpty(id))
  65. return Error("请输入ID");
  66. //Model.T_Com_LogAction model = busLogAction.GetModel(id);
  67. if (busLogAction.Delete(id))
  68. {//JsonConvert.SerializeObject(model)
  69. AddAction("t_com_logaction", id, "删除操作日志" );
  70. return Success("删除成功");
  71. }
  72. else
  73. return Error("失败");
  74. }
  75. }
  76. }