地铁二期项目正式开始

LogActionController.cs 2.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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 = " 1=1 ";
  33. if (!string.IsNullOrEmpty(Table))
  34. {
  35. strWhere += string.Format(" and TableName = '{0}'", Table);
  36. }
  37. if (!string.IsNullOrEmpty(id))
  38. {
  39. strWhere += string.Format(" and TableId ={0}", id);
  40. }
  41. DataTable dt = busLogAction.GetListByPage(strWhere, " atime desc ", (page - 1) * limit, limit).Tables[0];
  42. int count = busLogAction.GetRecordCount(strWhere);
  43. return Success("成功", dt, count);
  44. }
  45. [ActionName("GetData")]
  46. public string GettData(string id)
  47. {
  48. if (string.IsNullOrEmpty(id))
  49. return Error("请输入ID");
  50. Model.T_Com_LogAction model = busLogAction.GetModel(id);
  51. return Success("成功", model, 1);
  52. }
  53. [ActionName("deletedata")]
  54. public string DeleteData(string id)
  55. {
  56. if (string.IsNullOrEmpty(id))
  57. return Error("请输入ID");
  58. Model.T_Com_LogAction model = busLogAction.GetModel(id);
  59. if (busLogAction.Delete(id))
  60. {
  61. AddLog("T_Com_LogAction", model.Id, "删除消息", JsonConvert.SerializeObject(model), "");
  62. return Success("删除成功");
  63. }
  64. else
  65. return Error("失败");
  66. }
  67. }
  68. }