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.6 KiB

  1. using Learun.Util;
  2. using System.Data;
  3. using Learun.Application.TwoDevelopment.PersonnelManagement;
  4. using System.Web.Mvc;
  5. using System.Collections.Generic;
  6. using System;
  7. namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers
  8. {
  9. /// <summary>
  10. /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
  11. /// Copyright (c) 2013-2018 北京泉江科技有限公司
  12. /// 创 建:超级管理员
  13. /// 日 期:2020-03-04 16:01
  14. /// 描 述:岗位申请
  15. /// </summary>
  16. public class WorkStudyPositionApplyController : MvcControllerBase
  17. {
  18. private WorkStudyPositionApplyIBLL workStudyPositionApplyIBLL = new WorkStudyPositionApplyBLL();
  19. #region 视图功能
  20. /// <summary>
  21. /// 主页面
  22. /// <summary>
  23. /// <returns></returns>
  24. [HttpGet]
  25. public ActionResult Index()
  26. {
  27. return View();
  28. }
  29. /// <summary>
  30. /// 表单页
  31. /// <summary>
  32. /// <returns></returns>
  33. [HttpGet]
  34. public ActionResult Form()
  35. {
  36. return View();
  37. }
  38. /// <summary>
  39. /// 表单页-查看
  40. /// <summary>
  41. /// <returns></returns>
  42. [HttpGet]
  43. public ActionResult FormView()
  44. {
  45. return View();
  46. }
  47. /// <summary>
  48. /// 主页面-审核
  49. /// <summary>
  50. /// <returns></returns>
  51. [HttpGet]
  52. public ActionResult CheckIndex()
  53. {
  54. return View();
  55. }
  56. #endregion
  57. #region 获取数据
  58. /// <summary>
  59. /// 获取页面显示列表数据
  60. /// <summary>
  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 = workStudyPositionApplyIBLL.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. /// <returns></returns>
  82. [HttpGet]
  83. [AjaxOnly]
  84. public ActionResult GetFormData(string keyValue)
  85. {
  86. var WorkStudyPositionApplyData = workStudyPositionApplyIBLL.GetWorkStudyPositionApplyEntity(keyValue);
  87. var jsonData = new
  88. {
  89. WorkStudyPositionApply = WorkStudyPositionApplyData,
  90. };
  91. return Success(jsonData);
  92. }
  93. #endregion
  94. #region 提交数据
  95. /// <summary>
  96. /// 删除实体数据
  97. /// <param name="keyValue">主键</param>
  98. /// <summary>
  99. /// <returns></returns>
  100. [HttpPost]
  101. [AjaxOnly]
  102. public ActionResult DeleteForm(string keyValue)
  103. {
  104. workStudyPositionApplyIBLL.DeleteEntity(keyValue);
  105. return Success("删除成功!");
  106. }
  107. /// <summary>
  108. /// 保存实体数据(新增、修改)
  109. /// <param name="keyValue">主键</param>
  110. /// <summary>
  111. /// <returns></returns>
  112. [HttpPost]
  113. [ValidateAntiForgeryToken]
  114. [AjaxOnly]
  115. public ActionResult SaveForm(string keyValue, string strEntity)
  116. {
  117. WorkStudyPositionApplyEntity entity = strEntity.ToObject<WorkStudyPositionApplyEntity>();
  118. entity.CreateTime = DateTime.Now;
  119. entity.CreateUserId = LoginUserInfo.Get().userId;
  120. workStudyPositionApplyIBLL.SaveEntity(keyValue, entity);
  121. return Success("保存成功!");
  122. }
  123. /// <summary>
  124. /// 审核实体数据
  125. /// <param name="keyValue">主键</param>
  126. /// <summary>
  127. /// <returns></returns>
  128. [HttpPost]
  129. [AjaxOnly]
  130. public ActionResult DoCheck(string keyValue, string checkStatus)
  131. {
  132. var entity = workStudyPositionApplyIBLL.GetWorkStudyPositionApplyEntity(keyValue);
  133. if (entity == null)
  134. {
  135. return Fail("数据不存在!");
  136. }
  137. entity.CheckStatus = checkStatus;
  138. entity.CheckTime = DateTime.Now;
  139. entity.CheckUserId = LoginUserInfo.Get().userId;
  140. workStudyPositionApplyIBLL.SaveEntity(keyValue, entity);
  141. return Success("操作成功!");
  142. }
  143. #endregion
  144. }
  145. }