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.
 
 
 
 
 
 

155 lines
4.4 KiB

  1. using Learun.Util;
  2. using System.Data;
  3. using Learun.Application.TwoDevelopment.EducationalAdministration;
  4. using System.Web.Mvc;
  5. using System.Collections.Generic;
  6. namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
  7. {
  8. /// <summary>
  9. /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
  10. /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  11. /// 创 建:超级管理员
  12. /// 日 期:2021-09-24 10:33
  13. /// 描 述:AwardAndPunishment
  14. /// </summary>
  15. public class AwardAndPunishmentController : MvcControllerBase
  16. {
  17. private AwardAndPunishmentIBLL awardAndPunishmentIBLL = new AwardAndPunishmentBLL();
  18. #region 视图功能
  19. /// <summary>
  20. /// 主页面
  21. /// <summary>
  22. /// <returns></returns>
  23. [HttpGet]
  24. public ActionResult Index()
  25. {
  26. return View();
  27. }
  28. /// <summary>
  29. /// 主页面
  30. /// <summary>
  31. /// <returns></returns>
  32. [HttpGet]
  33. public ActionResult IndexPunishment()
  34. {
  35. return View();
  36. }
  37. /// <summary>
  38. /// 表单页
  39. /// <summary>
  40. /// <returns></returns>
  41. [HttpGet]
  42. public ActionResult Form()
  43. {
  44. return View();
  45. }
  46. /// <summary>
  47. /// 表单页
  48. /// <summary>
  49. /// <returns></returns>
  50. [HttpGet]
  51. public ActionResult AwardForm()
  52. {
  53. return View();
  54. }
  55. #endregion
  56. #region 获取数据
  57. /// <summary>
  58. /// 获取页面显示列表数据
  59. /// </summary>
  60. /// <param name="pagination">分页参数</param>
  61. /// <param name="queryJson">查询参数</param>
  62. /// <returns></returns>
  63. [HttpGet]
  64. [AjaxOnly]
  65. public ActionResult GetPageList(string pagination, string queryJson)
  66. {
  67. Pagination paginationobj = pagination.ToObject<Pagination>();
  68. var data = awardAndPunishmentIBLL.GetPageList(paginationobj, queryJson);
  69. var jsonData = new
  70. {
  71. rows = data,
  72. total = paginationobj.total,
  73. page = paginationobj.page,
  74. records = paginationobj.records
  75. };
  76. return Success(jsonData);
  77. }
  78. /// <summary>
  79. /// 获取表单数据
  80. /// </summary>
  81. /// <param name="keyValue">主键</param>
  82. /// <returns></returns>
  83. [HttpGet]
  84. [AjaxOnly]
  85. public ActionResult GetFormData(string keyValue)
  86. {
  87. var AwardAndPunishmentData = awardAndPunishmentIBLL.GetAwardAndPunishmentEntity( keyValue );
  88. var jsonData = new {
  89. AwardAndPunishment = AwardAndPunishmentData,
  90. };
  91. return Success(jsonData);
  92. }
  93. #endregion
  94. #region 提交数据
  95. /// <summary>
  96. /// 删除实体数据
  97. /// </summary>
  98. /// <param name="keyValue">主键</param>
  99. /// <returns></returns>
  100. [HttpPost]
  101. [AjaxOnly]
  102. public ActionResult DeleteForm(string keyValue)
  103. {
  104. awardAndPunishmentIBLL.DeleteEntity(keyValue);
  105. return Success("删除成功!");
  106. }
  107. /// <summary>
  108. /// 保存实体数据(新增、修改)
  109. /// </summary>
  110. /// <param name="keyValue">主键</param>
  111. /// <param name="strEntity">实体</param>
  112. /// <returns></returns>
  113. [HttpPost]
  114. [ValidateAntiForgeryToken]
  115. [AjaxOnly]
  116. public ActionResult SaveForm(string keyValue, string strEntity)
  117. {
  118. AwardAndPunishmentEntity entity = strEntity.ToObject<AwardAndPunishmentEntity>();
  119. awardAndPunishmentIBLL.SaveEntity(keyValue,entity);
  120. if (string.IsNullOrEmpty(keyValue))
  121. {
  122. }
  123. return Success("保存成功!");
  124. }
  125. #endregion
  126. #region 扩展数据
  127. /// <summary>
  128. /// 启用/禁用
  129. /// </summary>
  130. /// <param name="keyValue"></param>
  131. /// <param name="status"></param>
  132. /// <returns></returns>
  133. [HttpPost]
  134. [AjaxOnly]
  135. public ActionResult EnableDisable(string keyValue, string status)
  136. {
  137. awardAndPunishmentIBLL.EnableDisable(keyValue, status);
  138. return Success("操作成功!");
  139. }
  140. #endregion
  141. }
  142. }