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.

StuLeaveManagementController.cs 5.6 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  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 CheckIndex()
  45. {
  46. ViewBag.IsDeptDirector = false; //登录用户是否是系主任标识
  47. var deptDirectorRoleId = Config.GetValue("DeptDirectorRoleId");
  48. var loginInfoRoleIds = LoginUserInfo.Get().roleIds;
  49. if (loginInfoRoleIds.IndexOf(',') == -1)
  50. {
  51. if (loginInfoRoleIds == deptDirectorRoleId)
  52. {
  53. ViewBag.IsDeptDirector = true;
  54. }
  55. }
  56. else
  57. {
  58. if (loginInfoRoleIds.Split(',').Contains(deptDirectorRoleId))
  59. {
  60. ViewBag.IsDeptDirector = true;
  61. }
  62. }
  63. return View();
  64. }
  65. /// <summary>
  66. /// 表单页【学工信息管理】
  67. /// <summary>
  68. /// <returns></returns>
  69. [HttpGet]
  70. public ActionResult CheckForm()
  71. {
  72. return View();
  73. }
  74. #endregion
  75. #region 获取数据
  76. /// <summary>
  77. /// 获取页面显示列表数据
  78. /// </summary>
  79. /// <param name="pagination">分页参数</param>
  80. /// <param name="queryJson">查询参数</param>
  81. /// <returns></returns>
  82. [HttpGet]
  83. [AjaxOnly]
  84. public ActionResult GetPageList(string pagination, string queryJson)
  85. {
  86. Pagination paginationobj = pagination.ToObject<Pagination>();
  87. var data = stuLeaveManagementIBLL.GetPageList(paginationobj, queryJson);
  88. var jsonData = new
  89. {
  90. rows = data,
  91. total = paginationobj.total,
  92. page = paginationobj.page,
  93. records = paginationobj.records
  94. };
  95. return Success(jsonData);
  96. }
  97. /// <summary>
  98. /// 获取表单数据
  99. /// </summary>
  100. /// <param name="keyValue">主键</param>
  101. /// <returns></returns>
  102. [HttpGet]
  103. [AjaxOnly]
  104. public ActionResult GetFormData(string keyValue)
  105. {
  106. var StuLeaveManagementData = stuLeaveManagementIBLL.GetStuLeaveManagementEntity(keyValue);
  107. var jsonData = new
  108. {
  109. StuLeaveManagement = StuLeaveManagementData,
  110. };
  111. return Success(jsonData);
  112. }
  113. #endregion
  114. #region 提交数据
  115. /// <summary>
  116. /// 删除实体数据
  117. /// </summary>
  118. /// <param name="keyValue">主键</param>
  119. /// <returns></returns>
  120. [HttpPost]
  121. [AjaxOnly]
  122. public ActionResult DeleteForm(string keyValue)
  123. {
  124. stuLeaveManagementIBLL.DeleteEntity(keyValue);
  125. return Success("删除成功!");
  126. }
  127. /// <summary>
  128. /// 保存实体数据(新增、修改)
  129. /// </summary>
  130. /// <param name="keyValue">主键</param>
  131. /// <param name="strEntity">实体</param>
  132. /// <returns></returns>
  133. [HttpPost]
  134. [ValidateAntiForgeryToken]
  135. [AjaxOnly]
  136. public ActionResult SaveForm(string keyValue, string strEntity)
  137. {
  138. var loginInfo = LoginUserInfo.Get();
  139. StuLeaveManagementEntity entity = strEntity.ToObject<StuLeaveManagementEntity>();
  140. entity.CreateUserId = loginInfo.userId;
  141. entity.CreateUserNo = loginInfo.account;
  142. entity.CreateTime = DateTime.Now;
  143. stuLeaveManagementIBLL.SaveEntity(keyValue, entity);
  144. return Success("保存成功!");
  145. }
  146. /// <summary>
  147. /// 保存实体数据(新增、修改)
  148. /// </summary>
  149. /// <param name="keyValue">主键</param>
  150. /// <param name="strEntity">实体</param>
  151. /// <returns></returns>
  152. [HttpPost]
  153. [ValidateAntiForgeryToken]
  154. [AjaxOnly]
  155. public ActionResult SaveCheckForm(string keyValue, string strEntity)
  156. {
  157. var loginInfo = LoginUserInfo.Get();
  158. StuLeaveManagementEntity entity = strEntity.ToObject<StuLeaveManagementEntity>();
  159. entity.CheckUserId = loginInfo.userId;
  160. entity.CheckUserNo = loginInfo.account;
  161. entity.CheckTime = DateTime.Now;
  162. stuLeaveManagementIBLL.SaveEntity(keyValue, entity);
  163. return Success("保存成功!");
  164. }
  165. #endregion
  166. }
  167. }