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.
 
 
 
 
 
 

209 lines
6.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. using System;
  7. using System.Linq;
  8. namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
  9. {
  10. /// <summary>
  11. /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
  12. /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  13. /// 创 建:超级管理员
  14. /// 日 期:2020-11-27 10:05
  15. /// 描 述:学生请假管理
  16. /// </summary>
  17. public class StuLeaveManagementController : MvcControllerBase
  18. {
  19. private StuLeaveManagementIBLL stuLeaveManagementIBLL = new StuLeaveManagementBLL();
  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. /// <summary>
  49. /// 主页面【学工信息管理】
  50. /// <summary>
  51. /// <returns></returns>
  52. [HttpGet]
  53. public ActionResult CheckIndex()
  54. {
  55. ViewBag.IsDeptDirector = false; //登录用户是否是系主任标识
  56. var deptDirectorRoleId = Config.GetValue("DeptDirectorRoleId");
  57. var loginInfoRoleIds = LoginUserInfo.Get().roleIds;
  58. if (loginInfoRoleIds.IndexOf(',') == -1)
  59. {
  60. if (loginInfoRoleIds == deptDirectorRoleId)
  61. {
  62. ViewBag.IsDeptDirector = true;
  63. }
  64. }
  65. else
  66. {
  67. if (loginInfoRoleIds.Split(',').Contains(deptDirectorRoleId))
  68. {
  69. ViewBag.IsDeptDirector = true;
  70. }
  71. }
  72. return View();
  73. }
  74. /// <summary>
  75. /// 表单页【学工信息管理】
  76. /// <summary>
  77. /// <returns></returns>
  78. [HttpGet]
  79. public ActionResult CheckForm()
  80. {
  81. return View();
  82. }
  83. #endregion
  84. #region 获取数据
  85. /// <summary>
  86. /// 获取页面显示列表数据
  87. /// </summary>
  88. /// <param name="pagination">分页参数</param>
  89. /// <param name="queryJson">查询参数</param>
  90. /// <returns></returns>
  91. [HttpGet]
  92. [AjaxOnly]
  93. public ActionResult GetPageList(string pagination, string queryJson)
  94. {
  95. Pagination paginationobj = pagination.ToObject<Pagination>();
  96. var data = stuLeaveManagementIBLL.GetPageList(paginationobj, queryJson);
  97. var jsonData = new
  98. {
  99. rows = data,
  100. total = paginationobj.total,
  101. page = paginationobj.page,
  102. records = paginationobj.records
  103. };
  104. return Success(jsonData);
  105. }
  106. /// <summary>
  107. /// 获取表单数据
  108. /// </summary>
  109. /// <param name="keyValue">主键</param>
  110. /// <returns></returns>
  111. [HttpGet]
  112. [AjaxOnly]
  113. public ActionResult GetFormData(string keyValue)
  114. {
  115. var StuLeaveManagementData = stuLeaveManagementIBLL.GetStuLeaveManagementEntity(keyValue);
  116. var jsonData = new
  117. {
  118. StuLeaveManagement = StuLeaveManagementData,
  119. };
  120. return Success(jsonData);
  121. }
  122. [HttpGet]
  123. [AjaxOnly]
  124. public ActionResult GetFormDataByProcessId(string processId)
  125. {
  126. var StuLeaveManagementData = stuLeaveManagementIBLL.GetEntityByProcessId(processId);
  127. var jsonData = new
  128. {
  129. StuLeaveManagement = StuLeaveManagementData,
  130. };
  131. return Success(jsonData);
  132. }
  133. #endregion
  134. #region 提交数据
  135. /// <summary>
  136. /// 删除实体数据
  137. /// </summary>
  138. /// <param name="keyValue">主键</param>
  139. /// <returns></returns>
  140. [HttpPost]
  141. [AjaxOnly]
  142. public ActionResult DeleteForm(string keyValue)
  143. {
  144. stuLeaveManagementIBLL.DeleteEntity(keyValue);
  145. return Success("删除成功!");
  146. }
  147. /// <summary>
  148. /// 保存实体数据(新增、修改)
  149. /// </summary>
  150. /// <param name="keyValue">主键</param>
  151. /// <param name="strEntity">实体</param>
  152. /// <returns></returns>
  153. [HttpPost]
  154. [ValidateAntiForgeryToken]
  155. [AjaxOnly]
  156. public ActionResult SaveForm(string keyValue, string strEntity)
  157. {
  158. StuLeaveManagementEntity entity = strEntity.ToObject<StuLeaveManagementEntity>();
  159. stuLeaveManagementIBLL.SaveEntity(keyValue, entity);
  160. return Success("保存成功!");
  161. }
  162. /// <summary>
  163. /// 保存实体数据(新增、修改)
  164. /// </summary>
  165. /// <param name="keyValue">主键</param>
  166. /// <param name="strEntity">实体</param>
  167. /// <returns></returns>
  168. [HttpPost]
  169. [ValidateAntiForgeryToken]
  170. [AjaxOnly]
  171. public ActionResult SaveCheckForm(string keyValue, string strEntity)
  172. {
  173. var loginInfo = LoginUserInfo.Get();
  174. StuLeaveManagementEntity entity = strEntity.ToObject<StuLeaveManagementEntity>();
  175. entity.CheckUserId = loginInfo.userId;
  176. entity.CheckUserNo = loginInfo.account;
  177. entity.CheckTime = DateTime.Now;
  178. stuLeaveManagementIBLL.SaveEntity(keyValue, entity);
  179. return Success("保存成功!");
  180. }
  181. /// <summary>
  182. /// 提交--修改状态
  183. /// </summary>
  184. /// <param name="keyValue">主键</param>
  185. /// <returns></returns>
  186. [HttpPost]
  187. [AjaxOnly]
  188. public ActionResult ModifyStatus(string keyValue,string CheckStatus,string processId)
  189. {
  190. stuLeaveManagementIBLL.ModifyStatus(keyValue, CheckStatus, processId);
  191. return Success("保存成功!");
  192. }
  193. #endregion
  194. }
  195. }