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.
 
 
 
 
 
 

157 lines
4.9 KiB

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