選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

TeachSwitchController.cs 3.4 KiB

4年前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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-Ultimate V7.0.0 数字化智慧校园
  10. /// Copyright (c) 2013-2018 北京泉江科技有限公司
  11. /// 创 建:超级管理员
  12. /// 日 期:2019-07-08 17:19
  13. /// 描 述:教师注册功能开关控制
  14. /// </summary>
  15. public class TeachSwitchController : MvcControllerBase
  16. {
  17. private TeachSwitchIBLL teachSwitchIBLL = new TeachSwitchBLL();
  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. #endregion
  38. #region 获取数据
  39. /// <summary>
  40. /// 获取页面显示列表数据
  41. /// <summary>
  42. /// <param name="queryJson">查询参数</param>
  43. /// <returns></returns>
  44. [HttpGet]
  45. [AjaxOnly]
  46. public ActionResult GetPageList(string pagination, string queryJson)
  47. {
  48. Pagination paginationobj = pagination.ToObject<Pagination>();
  49. var data = teachSwitchIBLL.GetPageList(paginationobj, queryJson);
  50. var jsonData = new
  51. {
  52. rows = data,
  53. total = paginationobj.total,
  54. page = paginationobj.page,
  55. records = paginationobj.records
  56. };
  57. return Success(jsonData);
  58. }
  59. /// <summary>
  60. /// 获取表单数据
  61. /// <summary>
  62. /// <returns></returns>
  63. [HttpGet]
  64. [AjaxOnly]
  65. public ActionResult GetFormData(string keyValue)
  66. {
  67. var TeachSwitchData = teachSwitchIBLL.GetTeachSwitchEntity(keyValue);
  68. var jsonData = new
  69. {
  70. TeachSwitch = TeachSwitchData,
  71. };
  72. return Success(jsonData);
  73. }
  74. [HttpGet]
  75. [AjaxOnly]
  76. public ActionResult GetFirstEntity(string type)
  77. {
  78. var result = teachSwitchIBLL.GetFirst(type);
  79. return Success(result);
  80. }
  81. #endregion
  82. #region 提交数据
  83. /// <summary>
  84. /// 删除实体数据
  85. /// <param name="keyValue">主键</param>
  86. /// <summary>
  87. /// <returns></returns>
  88. [HttpPost]
  89. [AjaxOnly]
  90. public ActionResult DeleteForm(string keyValue)
  91. {
  92. teachSwitchIBLL.DeleteEntity(keyValue);
  93. return Success("删除成功!");
  94. }
  95. /// <summary>
  96. /// 保存实体数据(新增、修改)
  97. /// <param name="keyValue">主键</param>
  98. /// <summary>
  99. /// <returns></returns>
  100. [HttpPost]
  101. [ValidateAntiForgeryToken]
  102. [AjaxOnly]
  103. public ActionResult SaveForm(string keyValue, string strEntity)
  104. {
  105. TeachSwitchEntity entity = strEntity.ToObject<TeachSwitchEntity>();
  106. teachSwitchIBLL.SaveEntity(keyValue, entity);
  107. return Success("保存成功!");
  108. }
  109. #endregion
  110. }
  111. }