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.
 
 
 
 
 
 

174 lines
5.3 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.Threading.Tasks;
  7. namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
  8. {
  9. /// <summary>
  10. /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
  11. /// Copyright (c) 2013-2018 北京泉江科技有限公司
  12. /// 创 建:超级管理员
  13. /// 日 期:2019-05-14 09:49
  14. /// 描 述:选修课排课
  15. /// </summary>
  16. public class ArrangeLessonTermOfElectiveController : MvcControllerBase
  17. {
  18. private ArrangeLessonTermOfElectiveIBLL arrangeLessonTermOfElectiveIBLL = new ArrangeLessonTermOfElectiveBLL();
  19. #region 视图功能
  20. /// <summary>
  21. /// 主页面
  22. /// <summary>
  23. /// <returns></returns>
  24. [HttpGet]
  25. public ActionResult EmptyByConditionForm()
  26. {
  27. return View();
  28. }
  29. [HttpGet]
  30. public ActionResult SyncByConditionForm()
  31. {
  32. return View();
  33. }
  34. [HttpGet]
  35. public ActionResult Index()
  36. {
  37. return View();
  38. }
  39. /// <summary>
  40. /// 表单页
  41. /// <summary>
  42. /// <returns></returns>
  43. [HttpGet]
  44. public ActionResult Form()
  45. {
  46. return View();
  47. }
  48. #endregion
  49. #region 获取数据
  50. /// <summary>
  51. /// 获取页面显示列表数据
  52. /// <summary>
  53. /// <param name="queryJson">查询参数</param>
  54. /// <returns></returns>
  55. [HttpGet]
  56. [AjaxOnly]
  57. public ActionResult GetPageList(string pagination, string queryJson)
  58. {
  59. Pagination paginationobj = pagination.ToObject<Pagination>();
  60. var data = arrangeLessonTermOfElectiveIBLL.GetPageList(paginationobj, queryJson);
  61. var jsonData = new
  62. {
  63. rows = data,
  64. total = paginationobj.total,
  65. page = paginationobj.page,
  66. records = paginationobj.records
  67. };
  68. return Success(jsonData);
  69. }
  70. /// <summary>
  71. /// 获取表单数据
  72. /// <summary>
  73. /// <returns></returns>
  74. [HttpGet]
  75. [AjaxOnly]
  76. public ActionResult GetFormData(string keyValue)
  77. {
  78. var ArrangeLessonTermOfElectiveData = arrangeLessonTermOfElectiveIBLL.GetArrangeLessonTermOfElectiveEntity( keyValue );
  79. var jsonData = new {
  80. ArrangeLessonTermOfElective = ArrangeLessonTermOfElectiveData,
  81. };
  82. return Success(jsonData);
  83. }
  84. #endregion
  85. #region 提交数据
  86. /// <summary>
  87. /// 删除实体数据
  88. /// <param name="keyValue">主键</param>
  89. /// <summary>
  90. /// <returns></returns>
  91. [HttpPost]
  92. [AjaxOnly]
  93. public ActionResult DeleteForm(string keyValue)
  94. {
  95. arrangeLessonTermOfElectiveIBLL.DeleteEntity(keyValue);
  96. return Success("删除成功!");
  97. }
  98. /// <summary>
  99. /// 保存实体数据(新增、修改)
  100. /// <param name="keyValue">主键</param>
  101. /// <summary>
  102. /// <returns></returns>
  103. [HttpPost]
  104. [ValidateAntiForgeryToken]
  105. [AjaxOnly]
  106. public ActionResult SaveForm(string keyValue, string strEntity)
  107. {
  108. ArrangeLessonTermOfElectiveEntity entity = strEntity.ToObject<ArrangeLessonTermOfElectiveEntity>();
  109. arrangeLessonTermOfElectiveIBLL.SaveEntity(keyValue,entity);
  110. return Success("保存成功!");
  111. }
  112. #endregion
  113. #region 扩展数据
  114. /// <summary>
  115. /// 当前学期选修排课数据同步
  116. /// </summary>
  117. /// <returns></returns>
  118. [HttpGet]
  119. [AjaxOnly]
  120. public async Task<ActionResult> AsyncArrangeLessonOfElectiveData()
  121. {
  122. var data = await arrangeLessonTermOfElectiveIBLL.AsyncArrangeLessonOfElectiveData();
  123. return Success(data);
  124. }
  125. /// <summary>
  126. /// 清空当前学期选修排课数据
  127. /// </summary>
  128. /// <returns></returns>
  129. [HttpGet]
  130. [AjaxOnly]
  131. public async Task<ActionResult> AsyncModifyArrangeLessonOfElectiveData()
  132. {
  133. var data = await arrangeLessonTermOfElectiveIBLL.AsyncModifyArrangeLessonOfElectiveData();
  134. return Success(data);
  135. }
  136. /// <summary>
  137. /// 按条件清空排课数据
  138. /// </summary>
  139. /// <returns></returns>
  140. [HttpPost]
  141. [AjaxOnly]
  142. public async Task<ActionResult> AsyncModifyArrangeLessonDataByCondition(ArrangeLessonTermOfElectiveEntity entity)
  143. {
  144. var data = await arrangeLessonTermOfElectiveIBLL.AsyncModifyArrangeLessonDataByCondition(entity);
  145. return Success(data);
  146. }
  147. /// <summary>
  148. /// 按条件同步排课数据
  149. /// </summary>
  150. /// <returns></returns>
  151. [HttpPost]
  152. [AjaxOnly]
  153. public async Task<ActionResult> AsyncArrangeLessonDataByCondition(ArrangeLessonTermOfElectiveEntity entity)
  154. {
  155. var data = await arrangeLessonTermOfElectiveIBLL.AsyncArrangeLessonDataByCondition(entity);
  156. return Success(data);
  157. }
  158. #endregion
  159. }
  160. }