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.
 
 
 
 
 
 

142 lines
4.2 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;
  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. /// 日 期:2020-05-06 11:20
  14. /// 描 述:在线报名
  15. /// </summary>
  16. public class SignUpAboutOnlineController : MvcControllerBase
  17. {
  18. private SignUpAboutOnlineIBLL signUpAboutOnlineIBLL = new SignUpAboutOnlineBLL();
  19. #region 视图功能
  20. /// <summary>
  21. /// 主页面
  22. /// <summary>
  23. /// <returns></returns>
  24. [HttpGet]
  25. public ActionResult Index()
  26. {
  27. return View();
  28. }
  29. /// <summary>
  30. /// 表单页
  31. /// <summary>
  32. /// <returns></returns>
  33. [HttpGet]
  34. public ActionResult Form()
  35. {
  36. return View();
  37. }
  38. #endregion
  39. #region 获取数据
  40. /// <summary>
  41. /// 获取页面显示列表数据
  42. /// <summary>
  43. /// <param name="queryJson">查询参数</param>
  44. /// <returns></returns>
  45. [HttpGet]
  46. [AjaxOnly]
  47. public ActionResult GetPageList(string pagination, string queryJson)
  48. {
  49. Pagination paginationobj = pagination.ToObject<Pagination>();
  50. var data = signUpAboutOnlineIBLL.GetPageList(paginationobj, queryJson);
  51. var jsonData = new
  52. {
  53. rows = data,
  54. total = paginationobj.total,
  55. page = paginationobj.page,
  56. records = paginationobj.records
  57. };
  58. return Success(jsonData);
  59. }
  60. /// <summary>
  61. /// 获取表单数据
  62. /// <summary>
  63. /// <returns></returns>
  64. [HttpGet]
  65. [AjaxOnly]
  66. public ActionResult GetFormData(string keyValue)
  67. {
  68. var SignUpAboutOnlineData = signUpAboutOnlineIBLL.GetSignUpAboutOnlineEntity( keyValue );
  69. var jsonData = new {
  70. SignUpAboutOnline = SignUpAboutOnlineData,
  71. };
  72. return Success(jsonData);
  73. }
  74. #endregion
  75. #region 提交数据
  76. /// <summary>
  77. /// 删除实体数据
  78. /// <param name="keyValue">主键</param>
  79. /// <summary>
  80. /// <returns></returns>
  81. [HttpPost]
  82. [AjaxOnly]
  83. public ActionResult DeleteForm(string keyValue)
  84. {
  85. signUpAboutOnlineIBLL.DeleteEntity(keyValue);
  86. return Success("删除成功!");
  87. }
  88. /// <summary>
  89. /// 保存实体数据(新增、修改)
  90. /// <param name="keyValue">主键</param>
  91. /// <summary>
  92. /// <returns></returns>
  93. [HttpPost]
  94. [ValidateAntiForgeryToken]
  95. [AjaxOnly]
  96. public ActionResult SaveForm(string keyValue, string strEntity)
  97. {
  98. SignUpAboutOnlineEntity entity = strEntity.ToObject<SignUpAboutOnlineEntity>();
  99. if (string.IsNullOrEmpty(keyValue))
  100. {
  101. var model = signUpAboutOnlineIBLL.GetSignUpAboutOnlineEntityByIdCard(entity.IdCard);
  102. if (model != null)
  103. {
  104. return Fail("当前身份证号已报名!");
  105. }
  106. }
  107. entity.CreateTime = DateTime.Now;
  108. signUpAboutOnlineIBLL.SaveEntity(keyValue,entity);
  109. return Success("保存成功!");
  110. }
  111. /// <summary>
  112. /// 审核
  113. /// <param name="keyValue">主键</param>
  114. /// <summary>
  115. /// <returns></returns>
  116. [HttpPost]
  117. [AjaxOnly]
  118. public ActionResult DoCheck(string keyValue)
  119. {
  120. signUpAboutOnlineIBLL.DoCheck(keyValue);
  121. return Success("操作成功!");
  122. }
  123. [HttpPost]
  124. [AjaxOnly]
  125. public ActionResult DoUnCheck(string keyValue)
  126. {
  127. signUpAboutOnlineIBLL.DoUnCheck(keyValue);
  128. return Success("操作成功!");
  129. }
  130. #endregion
  131. }
  132. }