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.
 
 
 
 
 
 

215 lines
6.4 KiB

  1. using Learun.Application.TwoDevelopment.EducationalAdministration;
  2. using Learun.Util;
  3. using System.Data;
  4. using System.Linq;
  5. using System.Web.Mvc;
  6. namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
  7. {
  8. /// <summary>
  9. /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
  10. /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  11. /// 创 建:超级管理员
  12. /// 日 期:2023-03-13 10:37
  13. /// 描 述:定制功能助学金
  14. /// </summary>
  15. public class StuFellowshipController : MvcControllerBase
  16. {
  17. private StuFellowshipIBLL stuFellowshipIBLL = new StuFellowshipBLL();
  18. private ClassInfoIBLL classInfoIBLL = new ClassInfoBLL();
  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. var logUser = LoginUserInfo.Get();
  37. var ClassNos = "";
  38. var Classinfo = classInfoIBLL.GetAllClass().Where(x => x.ClassTutorNo == logUser.account).ToList();
  39. if (Classinfo.Any())
  40. {
  41. foreach (var item in Classinfo)
  42. {
  43. ClassNos += item.ClassNo + ",";
  44. }
  45. }
  46. ViewBag.ClassNo = ClassNos.TrimEnd(',');
  47. return View();
  48. }
  49. /// <summary>
  50. /// 表单页【查看】
  51. /// </summary>
  52. /// <returns></returns>
  53. [HttpGet]
  54. public ActionResult FormView()
  55. {
  56. var logUser = LoginUserInfo.Get();
  57. var ClassNos = "";
  58. var Classinfo = classInfoIBLL.GetAllClass().Where(x => x.ClassTutorNo == logUser.account).ToList();
  59. if (Classinfo.Any())
  60. {
  61. foreach (var item in Classinfo)
  62. {
  63. ClassNos += item.ClassNo + ",";
  64. }
  65. }
  66. ViewBag.ClassNo = ClassNos.TrimEnd(',');
  67. return View();
  68. }
  69. /// <summary>
  70. /// 主页面【二级学院】
  71. /// </summary>
  72. /// <returns></returns>
  73. [HttpGet]
  74. public ActionResult IndexOfTwo()
  75. {
  76. return View();
  77. }
  78. /// <summary>
  79. /// 主页面【学工部】
  80. /// </summary>
  81. /// <returns></returns>
  82. [HttpGet]
  83. public ActionResult IndexOfThree()
  84. {
  85. return View();
  86. }
  87. /// <summary>
  88. /// 主页面【学生】
  89. /// </summary>
  90. /// <returns></returns>
  91. [HttpGet]
  92. public ActionResult IndexOfStudent()
  93. {
  94. return View();
  95. }
  96. #endregion
  97. #region 获取数据
  98. /// <summary>
  99. /// 获取列表数据
  100. /// </summary>
  101. /// <param name="queryJson">查询参数</param>
  102. /// <returns></returns>
  103. [HttpGet]
  104. [AjaxOnly]
  105. public ActionResult GetList(string queryJson)
  106. {
  107. var data = stuFellowshipIBLL.GetList(queryJson);
  108. return Success(data);
  109. }
  110. /// <summary>
  111. /// 获取列表分页数据
  112. /// </summary>
  113. /// <param name="pagination">分页参数</param>
  114. /// <param name="queryJson">查询参数</param>
  115. /// <returns></returns>
  116. [HttpGet]
  117. [AjaxOnly]
  118. public ActionResult GetPageList(string pagination, string queryJson)
  119. {
  120. Pagination paginationobj = pagination.ToObject<Pagination>();
  121. var data = stuFellowshipIBLL.GetPageList(paginationobj, queryJson);
  122. var jsonData = new
  123. {
  124. rows = data,
  125. total = paginationobj.total,
  126. page = paginationobj.page,
  127. records = paginationobj.records
  128. };
  129. return Success(jsonData);
  130. }
  131. /// <summary>
  132. /// 获取表单数据
  133. /// </summary>
  134. /// <param name="keyValue">主键</param>
  135. /// <returns></returns>
  136. [HttpGet]
  137. [AjaxOnly]
  138. public ActionResult GetFormData(string keyValue)
  139. {
  140. //var data = stuFellowshipIBLL.GetEntity(keyValue);
  141. //return Success(data);
  142. var stuFellowshipData = stuFellowshipIBLL.GetEntity(keyValue);
  143. var jsonData = new
  144. {
  145. StuFellowship = stuFellowshipData,
  146. };
  147. return Success(jsonData);
  148. }
  149. #endregion
  150. #region 提交数据
  151. /// <summary>
  152. /// 删除实体数据
  153. /// </summary>
  154. /// <param name="keyValue">主键</param>
  155. /// <returns></returns>
  156. [HttpPost]
  157. [AjaxOnly]
  158. public ActionResult DeleteForm(string keyValue)
  159. {
  160. stuFellowshipIBLL.DeleteEntity(keyValue);
  161. return Success("删除成功!");
  162. }
  163. /// <summary>
  164. /// 保存实体数据(新增、修改)
  165. /// </summary>
  166. /// <param name="keyValue">主键</param>
  167. /// <param name="entity">实体</param>
  168. /// <returns></returns>
  169. [HttpPost]
  170. [ValidateAntiForgeryToken]
  171. [AjaxOnly]
  172. public ActionResult SaveForm(string keyValue, string strEntity)
  173. {
  174. StuFellowshipEntity entity = strEntity.ToObject<StuFellowshipEntity>();
  175. stuFellowshipIBLL.SaveEntity(keyValue, entity);
  176. return Success("保存成功!");
  177. }
  178. /// <summary>
  179. /// 提交
  180. /// </summary>
  181. /// <param name="keyValue">主键</param>
  182. /// <returns></returns>
  183. [HttpPost]
  184. [AjaxOnly]
  185. public ActionResult DoSubmit(string keyValue, string status, string step)
  186. {
  187. stuFellowshipIBLL.DoSubmit(keyValue, status, step);
  188. return Success("操作成功!");
  189. }
  190. /// <summary>
  191. /// 退回
  192. /// </summary>
  193. /// <param name="keyValue">主键</param>
  194. /// <returns></returns>
  195. [HttpPost]
  196. [AjaxOnly]
  197. public ActionResult DoBack(string keyValue, string status, string step)
  198. {
  199. stuFellowshipIBLL.DoBack(keyValue, status, step);
  200. return Success("操作成功!");
  201. }
  202. #endregion
  203. }
  204. }