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.

Exam_InvigilateTeacherController.cs 5.8 KiB

2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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-14 09:49
  13. /// 描 述:监考老师
  14. /// </summary>
  15. public class Exam_InvigilateTeacherController : MvcControllerBase
  16. {
  17. private Exam_InvigilateTeacherIBLL exam_InvigilateTeacherIBLL = new Exam_InvigilateTeacherBLL();
  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_InvigilateTeacherIBLL.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_InvigilateTeacherData = exam_InvigilateTeacherIBLL.GetExam_InvigilateTeacherEntity( keyValue );
  79. var jsonData = new {
  80. Exam_InvigilateTeacher = Exam_InvigilateTeacherData,
  81. };
  82. return Success(jsonData);
  83. }
  84. /// <summary>
  85. /// 获取监考老师数据
  86. /// </summary>
  87. /// <returns></returns>
  88. [HttpGet]
  89. [AjaxOnly]
  90. public ActionResult GetList(string AcademicYearNo, int? Semester)
  91. {
  92. var data = exam_InvigilateTeacherIBLL.GetList(AcademicYearNo, Semester);
  93. return Success(data);
  94. }
  95. #endregion
  96. #region 提交数据
  97. /// <summary>
  98. /// 删除实体数据
  99. /// </summary>
  100. /// <param name="keyValue">主键</param>
  101. /// <returns></returns>
  102. [HttpPost]
  103. [AjaxOnly]
  104. public ActionResult DeleteForm(string keyValue)
  105. {
  106. exam_InvigilateTeacherIBLL.DeleteEntity(keyValue);
  107. return Success("删除成功!");
  108. }
  109. /// <summary>
  110. /// 保存实体数据(新增、修改)
  111. /// </summary>
  112. /// <param name="keyValue">主键</param>
  113. /// <param name="strEntity">实体</param>
  114. /// <returns></returns>
  115. [HttpPost]
  116. [ValidateAntiForgeryToken]
  117. [AjaxOnly]
  118. public ActionResult SaveForm(string keyValue, string strEntity)
  119. {
  120. Exam_InvigilateTeacherEntity entity = strEntity.ToObject<Exam_InvigilateTeacherEntity>();
  121. //判断教师编号有无重复
  122. var model = exam_InvigilateTeacherIBLL.GetEntityByWhere(entity.AcademicYearNo, entity.Semester,entity.EmpNo);
  123. if (model != null && string.IsNullOrEmpty(keyValue))
  124. {
  125. return Fail("教师编号重复!");
  126. }
  127. else if (model != null && !string.IsNullOrEmpty(keyValue) && keyValue != model.ITId)
  128. {
  129. return Fail("教师编号重复!");
  130. }
  131. exam_InvigilateTeacherIBLL.SaveEntity(keyValue,entity);
  132. if (string.IsNullOrEmpty(keyValue))
  133. {
  134. }
  135. return Success("保存成功!");
  136. }
  137. /// <summary>
  138. /// 启用/停用
  139. /// </summary>
  140. /// <param name="keyValue"></param>
  141. /// <param name="ITEnabled"></param>
  142. /// <returns></returns>
  143. [HttpPost]
  144. [AjaxOnly]
  145. public ActionResult Lock(string keyValue, int ITEnabled)
  146. {
  147. exam_InvigilateTeacherIBLL.Lock(keyValue, ITEnabled);
  148. return Success("操作成功!");
  149. }
  150. /// <summary>
  151. /// 导入教师基础数据
  152. /// </summary>
  153. /// <returns></returns>
  154. [HttpPost]
  155. [AjaxOnly]
  156. public ActionResult Import(string AcademicYearNo, string Semester)
  157. {
  158. int res = exam_InvigilateTeacherIBLL.Import(AcademicYearNo, Semester);
  159. return Success("导入" + res + "条数据!");
  160. }
  161. /// <summary>
  162. /// 按条件清空数据
  163. /// </summary>
  164. /// <returns></returns>
  165. [HttpPost]
  166. [AjaxOnly]
  167. public ActionResult DeleteWhere(string AcademicYearNo, string Semester)
  168. {
  169. int res = exam_InvigilateTeacherIBLL.DeleteWhere(AcademicYearNo, Semester);
  170. return Success("清空" + res + "条数据!");
  171. }
  172. #endregion
  173. }
  174. }