Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 
 
 

177 lignes
5.4 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. namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
  7. {
  8. /// <summary>
  9. /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
  10. /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  11. /// 创 建:超级管理员
  12. /// 日 期:2022-04-12 15:47
  13. /// 描 述:考试课程表
  14. /// </summary>
  15. public class Exam_ExamLessonController : MvcControllerBase
  16. {
  17. private Exam_ExamLessonIBLL exam_ExamLessonIBLL = new Exam_ExamLessonBLL();
  18. #region 视图功能
  19. /// <summary>
  20. /// 主页面
  21. /// <summary>
  22. /// <returns></returns>
  23. [HttpGet]
  24. public ActionResult Index()
  25. {
  26. return View();
  27. }
  28. /// <summary>
  29. /// 表单页
  30. /// <summary>
  31. /// <returns></returns>
  32. [HttpGet]
  33. public ActionResult Form()
  34. {
  35. return View();
  36. }
  37. /// <summary>
  38. /// 导入/清空数据
  39. /// </summary>
  40. /// <returns></returns>
  41. [HttpGet]
  42. public ActionResult FormYearSemester()
  43. {
  44. return View();
  45. }
  46. #endregion
  47. #region 获取数据
  48. /// <summary>
  49. /// 获取页面显示列表数据
  50. /// </summary>
  51. /// <param name="pagination">分页参数</param>
  52. /// <param name="queryJson">查询参数</param>
  53. /// <returns></returns>
  54. [HttpGet]
  55. [AjaxOnly]
  56. public ActionResult GetPageList(string pagination, string queryJson)
  57. {
  58. Pagination paginationobj = pagination.ToObject<Pagination>();
  59. var data = exam_ExamLessonIBLL.GetPageList(paginationobj, queryJson);
  60. var jsonData = new
  61. {
  62. rows = data,
  63. total = paginationobj.total,
  64. page = paginationobj.page,
  65. records = paginationobj.records
  66. };
  67. return Success(jsonData);
  68. }
  69. /// <summary>
  70. /// 获取表单数据
  71. /// </summary>
  72. /// <param name="keyValue">主键</param>
  73. /// <returns></returns>
  74. [HttpGet]
  75. [AjaxOnly]
  76. public ActionResult GetFormData(string keyValue)
  77. {
  78. var Exam_ExamLessonData = exam_ExamLessonIBLL.GetExam_ExamLessonEntity(keyValue);
  79. var jsonData = new
  80. {
  81. Exam_ExamLesson = Exam_ExamLessonData,
  82. };
  83. return Success(jsonData);
  84. }
  85. #endregion
  86. #region 提交数据
  87. /// <summary>
  88. /// 删除实体数据
  89. /// </summary>
  90. /// <param name="keyValue">主键</param>
  91. /// <returns></returns>
  92. [HttpPost]
  93. [AjaxOnly]
  94. public ActionResult DeleteForm(string keyValue)
  95. {
  96. exam_ExamLessonIBLL.DeleteEntity(keyValue);
  97. return Success("删除成功!");
  98. }
  99. /// <summary>
  100. /// 导入开课计划
  101. /// </summary>
  102. /// <returns></returns>
  103. [HttpPost]
  104. [AjaxOnly]
  105. public ActionResult Import(string AcademicYearNo, string Semester)
  106. {
  107. int res = exam_ExamLessonIBLL.Import(AcademicYearNo, Semester);
  108. return Success("导入" + res + "条数据!");
  109. }
  110. /// <summary>
  111. /// 按条件清空数据
  112. /// </summary>
  113. /// <returns></returns>
  114. [HttpPost]
  115. [AjaxOnly]
  116. public ActionResult DeleteWhere(string AcademicYearNo, string Semester)
  117. {
  118. int res = exam_ExamLessonIBLL.DeleteWhere(AcademicYearNo, Semester);
  119. return Success("清空" + res + "条数据!");
  120. }
  121. /// <summary>
  122. /// 保存实体数据(新增、修改)
  123. /// </summary>
  124. /// <param name="keyValue">主键</param>
  125. /// <param name="strEntity">实体</param>
  126. /// <returns></returns>
  127. [HttpPost]
  128. [ValidateAntiForgeryToken]
  129. [AjaxOnly]
  130. public ActionResult SaveForm(string keyValue, string strEntity)
  131. {
  132. Exam_ExamLessonEntity entity = strEntity.ToObject<Exam_ExamLessonEntity>();
  133. //判断课程编号有无重复
  134. var model = exam_ExamLessonIBLL.GetEntityByLessonNo(entity.LessonNo,entity.AcademicYearNo,entity.Semester);
  135. if (model != null && string.IsNullOrEmpty(keyValue))
  136. {
  137. return Fail("课程编号重复!");
  138. }
  139. else if (model != null && !string.IsNullOrEmpty(keyValue) && keyValue != model.ELId)
  140. {
  141. return Fail("课程编号重复!");
  142. }
  143. exam_ExamLessonIBLL.SaveEntity(keyValue, entity);
  144. if (string.IsNullOrEmpty(keyValue))
  145. {
  146. }
  147. return Success("保存成功!");
  148. }
  149. /// <summary>
  150. /// 启用/停用
  151. /// </summary>
  152. /// <param name="keyValue"></param>
  153. /// <param name="ELEnabled"></param>
  154. /// <returns></returns>
  155. [HttpPost]
  156. [AjaxOnly]
  157. public ActionResult Lock(string keyValue, int ELEnabled)
  158. {
  159. exam_ExamLessonIBLL.Lock(keyValue, ELEnabled);
  160. return Success("操作成功!");
  161. }
  162. #endregion
  163. }
  164. }