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.
 
 
 
 
 
 

224 lines
6.4 KiB

  1. using System;
  2. using Learun.Util;
  3. using System.Data;
  4. using Learun.Application.TwoDevelopment.EducationalAdministration;
  5. using System.Web.Mvc;
  6. using System.Collections.Generic;
  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. /// 日 期:2021-12-16 10:14
  15. /// 描 述:长阳迎新
  16. /// </summary>
  17. public class StuVolunteerController : MvcControllerBase
  18. {
  19. private StuVolunteerIBLL stuVolunteerIBLL = new StuVolunteerBLL();
  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 IndexLabel()
  45. {
  46. return View();
  47. }
  48. /// <summary>
  49. /// 志愿表单页
  50. /// <summary>
  51. /// <returns></returns>
  52. [HttpGet]
  53. public ActionResult FormSchool()
  54. {
  55. return View();
  56. }
  57. /// <summary>
  58. /// 志愿表单页
  59. /// <summary>
  60. /// <returns></returns>
  61. [HttpGet]
  62. public ActionResult IndexAccount()
  63. {
  64. return View();
  65. }
  66. #endregion
  67. #region 获取数据
  68. /// <summary>
  69. /// 获取页面显示列表数据
  70. /// </summary>
  71. /// <param name="pagination">分页参数</param>
  72. /// <param name="queryJson">查询参数</param>
  73. /// <returns></returns>
  74. [HttpGet]
  75. [AjaxOnly]
  76. public ActionResult GetPageList(string pagination, string queryJson)
  77. {
  78. Pagination paginationobj = pagination.ToObject<Pagination>();
  79. var data = stuVolunteerIBLL.GetPageList(paginationobj, queryJson);
  80. var jsonData = new
  81. {
  82. rows = data,
  83. total = paginationobj.total,
  84. page = paginationobj.page,
  85. records = paginationobj.records
  86. };
  87. return Success(jsonData);
  88. }
  89. /// <summary>
  90. /// 获取表单数据
  91. /// </summary>
  92. /// <param name="keyValue">主键</param>
  93. /// <returns></returns>
  94. [HttpGet]
  95. [AjaxOnly]
  96. public ActionResult GetFormData(string keyValue)
  97. {
  98. var StuVolunteerData = stuVolunteerIBLL.GetStuVolunteerEntity(keyValue);
  99. var jsonData = new
  100. {
  101. StuVolunteer = StuVolunteerData,
  102. };
  103. return Success(jsonData);
  104. }
  105. #endregion
  106. #region 提交数据
  107. /// <summary>
  108. /// 删除实体数据
  109. /// </summary>
  110. /// <param name="keyValue">主键</param>
  111. /// <returns></returns>
  112. [HttpPost]
  113. [AjaxOnly]
  114. public ActionResult DeleteForm(string keyValue)
  115. {
  116. stuVolunteerIBLL.DeleteEntity(keyValue);
  117. return Success("删除成功!");
  118. }
  119. /// <summary>
  120. /// 保存实体数据(新增、修改)
  121. /// </summary>
  122. /// <param name="keyValue">主键</param>
  123. /// <param name="strEntity">实体</param>
  124. /// <returns></returns>
  125. [HttpPost]
  126. [ValidateAntiForgeryToken]
  127. [AjaxOnly]
  128. public ActionResult SaveForm(string keyValue, string strEntity)
  129. {
  130. StuVolunteerEntity entity = strEntity.ToObject<StuVolunteerEntity>();
  131. var userInfo = LoginUserInfo.Get();
  132. if (string.IsNullOrEmpty(keyValue))
  133. {
  134. entity.CreateUser = userInfo.realName;
  135. entity.CreateTime = DateTime.Now;
  136. }
  137. entity.UpdateUser = userInfo.realName;
  138. entity.UpdateTime = DateTime.Now;
  139. var dWList =
  140. stuVolunteerIBLL.GetRepetitions(entity.H_SchoolNo, entity.ApplyNo, entity.CardNo).Where(x => x.ID != keyValue);
  141. if (dWList.Count() > 0)
  142. {
  143. return Fail("保存失败,请检查数据有重复项");
  144. }
  145. stuVolunteerIBLL.SaveEntity(keyValue, entity);
  146. return Success("保存成功!");
  147. }
  148. #endregion
  149. #region 扩展数据
  150. /// <summary>
  151. /// 标注数据
  152. /// </summary>
  153. /// <param name="keyValue"></param>
  154. /// <returns></returns>
  155. public ActionResult LabelForm(string keyValue)
  156. {
  157. stuVolunteerIBLL.LabelEntity(keyValue);
  158. return Success("标注成功!");
  159. }
  160. /// <summary>
  161. /// 取消数据
  162. /// </summary>
  163. /// <param name="keyValue"></param>
  164. /// <returns></returns>
  165. public ActionResult CancelLabel(string keyValue)
  166. {
  167. stuVolunteerIBLL.CancelLabel(keyValue);
  168. return Success("取消成功!");
  169. }
  170. /// <summary>
  171. /// 填报志愿
  172. /// </summary>
  173. /// <param name="keyValue"></param>
  174. /// <returns></returns>
  175. public ActionResult IsOurSchool(string keyValue, string strEntity)
  176. {
  177. StuVolunteerEntity entity = strEntity.ToObject<StuVolunteerEntity>();
  178. stuVolunteerIBLL.IsOurSchool(keyValue,entity);
  179. return Success("填报成功!");
  180. }
  181. /// <summary>
  182. /// 录取学生
  183. /// </summary>
  184. /// <param name="keyValue"></param>
  185. /// <returns></returns>
  186. public ActionResult EnrollForm(string keyValue)
  187. {
  188. stuVolunteerIBLL.EnrollEntity(keyValue);
  189. return Success("录取成功!");
  190. }
  191. /// <summary>
  192. /// 取消录取学生
  193. /// </summary>
  194. /// <param name="keyValue"></param>
  195. /// <returns></returns>
  196. public ActionResult CancelForm(string keyValue)
  197. {
  198. stuVolunteerIBLL.CancelEntity(keyValue);
  199. return Success("取消成功!");
  200. }
  201. #endregion
  202. }
  203. }