You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

JournalReceiveController.cs 3.6 KiB

4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. using Learun.Application.TwoDevelopment.EducationalAdministration;
  2. using Learun.Util;
  3. using System.Data;
  4. using System.Web.Mvc;
  5. using Learun.Application.Organization;
  6. using System.Web;
  7. namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
  8. {
  9. /// <summary>
  10. /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
  11. /// Copyright (c) 2013-2018 北京泉江科技有限公司
  12. /// 创 建:超级管理员
  13. /// 日 期:2019-03-06 17:17
  14. /// 描 述:查看日志
  15. /// </summary>
  16. public class JournalReceiveController : MvcControllerBase
  17. {
  18. private JournalReceiveIBLL journalReceiveIBLL = new JournalReceiveBLL();
  19. private UserIBLL userIbll = new UserBLL();
  20. #region 视图功能
  21. /// <summary>
  22. /// 主页面
  23. /// <summary>
  24. /// <returns></returns>
  25. [HttpGet]
  26. public ActionResult Index()
  27. {
  28. UserInfo logInfo = LoginUserInfo.Get();
  29. ViewBag.userId = logInfo.userId;
  30. return View();
  31. }
  32. /// <summary>
  33. /// 表单页
  34. /// <summary>
  35. /// <returns></returns>
  36. [HttpGet]
  37. public ActionResult Form()
  38. {
  39. return View();
  40. }
  41. #endregion
  42. #region 获取数据
  43. /// <summary>
  44. /// 获取列表分页数据
  45. /// <param name="pagination">分页参数</param>
  46. /// <summary>
  47. /// <returns></returns>
  48. [HttpGet]
  49. [AjaxOnly]
  50. public ActionResult GetPageList(string pagination, string queryJson)
  51. {
  52. Pagination paginationobj = pagination.ToObject<Pagination>();
  53. var data = journalReceiveIBLL.GetPageList(paginationobj, queryJson);
  54. var jsonData = new
  55. {
  56. rows = data,
  57. total = paginationobj.total,
  58. page = paginationobj.page,
  59. records = paginationobj.records
  60. };
  61. return Success(jsonData);
  62. }
  63. /// <summary>
  64. /// 获取表单数据
  65. /// <param name="keyValue">主键</param>
  66. /// <summary>
  67. /// <returns></returns>
  68. [HttpGet]
  69. [AjaxOnly]
  70. public ActionResult GetFormData(string keyValue)
  71. {
  72. var JournalReceive = journalReceiveIBLL.GetEntity(keyValue);
  73. JournalReceive.JContent = HttpUtility.HtmlDecode(JournalReceive.JContent);
  74. var jsonData = new
  75. {
  76. JournalReceive = JournalReceive,
  77. };
  78. return Success(jsonData);
  79. }
  80. #endregion
  81. #region 提交数据
  82. [HttpPost]
  83. [AjaxOnly]
  84. public ActionResult Read(string keyValue)
  85. {
  86. journalReceiveIBLL.Read(keyValue);
  87. return Success("Read成功!");
  88. }
  89. /// <summary>
  90. /// 删除实体数据
  91. /// <param name="keyValue">主键</param>
  92. /// <summary>
  93. /// <returns></returns>
  94. [HttpPost]
  95. [AjaxOnly]
  96. public ActionResult DeleteForm(string keyValue)
  97. {
  98. journalReceiveIBLL.DeleteEntity(keyValue);
  99. return Success("删除成功!");
  100. }
  101. /// <summary>
  102. /// 保存实体数据(新增、修改)
  103. /// <param name="keyValue">主键</param>
  104. /// <summary>
  105. /// <returns></returns>
  106. [HttpPost]
  107. [ValidateAntiForgeryToken]
  108. [AjaxOnly]
  109. public ActionResult SaveForm(string keyValue, JournalReceiveEntity entity)
  110. {
  111. journalReceiveIBLL.SaveEntity(keyValue, entity);
  112. return Success("保存成功!");
  113. }
  114. #endregion
  115. }
  116. }