No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 
 
 
 

176 líneas
5.5 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-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. #endregion
  85. #region 提交数据
  86. /// <summary>
  87. /// 删除实体数据
  88. /// </summary>
  89. /// <param name="keyValue">主键</param>
  90. /// <returns></returns>
  91. [HttpPost]
  92. [AjaxOnly]
  93. public ActionResult DeleteForm(string keyValue)
  94. {
  95. exam_InvigilateTeacherIBLL.DeleteEntity(keyValue);
  96. return Success("删除成功!");
  97. }
  98. /// <summary>
  99. /// 保存实体数据(新增、修改)
  100. /// </summary>
  101. /// <param name="keyValue">主键</param>
  102. /// <param name="strEntity">实体</param>
  103. /// <returns></returns>
  104. [HttpPost]
  105. [ValidateAntiForgeryToken]
  106. [AjaxOnly]
  107. public ActionResult SaveForm(string keyValue, string strEntity)
  108. {
  109. Exam_InvigilateTeacherEntity entity = strEntity.ToObject<Exam_InvigilateTeacherEntity>();
  110. //判断教师编号有无重复
  111. var model = exam_InvigilateTeacherIBLL.GetEntityByWhere(entity.AcademicYearNo, entity.Semester,entity.EmpNo);
  112. if (model != null && string.IsNullOrEmpty(keyValue))
  113. {
  114. return Fail("教师编号重复!");
  115. }
  116. else if (model != null && !string.IsNullOrEmpty(keyValue) && keyValue != model.ITId)
  117. {
  118. return Fail("教师编号重复!");
  119. }
  120. exam_InvigilateTeacherIBLL.SaveEntity(keyValue,entity);
  121. if (string.IsNullOrEmpty(keyValue))
  122. {
  123. }
  124. return Success("保存成功!");
  125. }
  126. /// <summary>
  127. /// 启用/停用
  128. /// </summary>
  129. /// <param name="keyValue"></param>
  130. /// <param name="ITEnabled"></param>
  131. /// <returns></returns>
  132. [HttpPost]
  133. [AjaxOnly]
  134. public ActionResult Lock(string keyValue, int ITEnabled)
  135. {
  136. exam_InvigilateTeacherIBLL.Lock(keyValue, ITEnabled);
  137. return Success("操作成功!");
  138. }
  139. /// <summary>
  140. /// 导入教师基础数据
  141. /// </summary>
  142. /// <returns></returns>
  143. [HttpPost]
  144. [AjaxOnly]
  145. public ActionResult Import(string AcademicYearNo, string Semester)
  146. {
  147. int res = exam_InvigilateTeacherIBLL.Import(AcademicYearNo, Semester);
  148. return Success("导入" + res + "条数据!");
  149. }
  150. /// <summary>
  151. /// 按条件清空数据
  152. /// </summary>
  153. /// <returns></returns>
  154. [HttpPost]
  155. [AjaxOnly]
  156. public ActionResult DeleteWhere(string AcademicYearNo, string Semester)
  157. {
  158. int res = exam_InvigilateTeacherIBLL.DeleteWhere(AcademicYearNo, Semester);
  159. return Success("清空" + res + "条数据!");
  160. }
  161. #endregion
  162. }
  163. }