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.
 
 
 
 
 
 

137 lines
4.0 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.IO;
  7. using System;
  8. using Learun.Application.Base.SystemModule;
  9. namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
  10. {
  11. /// <summary>
  12. /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
  13. /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  14. /// 创 建:超级管理员
  15. /// 日 期:2022-09-05 16:23
  16. /// 描 述:招聘人员报名
  17. /// </summary>
  18. public class HiringRegistrationController : MvcControllerBase
  19. {
  20. private HiringRegistrationIBLL hiringRegistrationIBLL = new HiringRegistrationBLL();
  21. #region 视图功能
  22. /// <summary>
  23. /// 主页面
  24. /// <summary>
  25. /// <returns></returns>
  26. [HttpGet]
  27. public ActionResult Index()
  28. {
  29. return View();
  30. }
  31. /// <summary>
  32. /// 表单页
  33. /// <summary>
  34. /// <returns></returns>
  35. [HttpGet]
  36. public ActionResult Form()
  37. {
  38. return View();
  39. }
  40. #endregion
  41. #region 获取数据
  42. /// <summary>
  43. /// 获取页面显示列表数据
  44. /// </summary>
  45. /// <param name="pagination">分页参数</param>
  46. /// <param name="queryJson">查询参数</param>
  47. /// <returns></returns>
  48. [HttpGet]
  49. [AjaxOnly]
  50. public ActionResult GetPageList(string pagination, string queryJson)
  51. {
  52. Pagination paginationobj = pagination.ToObject<Pagination>();
  53. var data = hiringRegistrationIBLL.GetPageList(paginationobj, queryJson);
  54. var jsonData = new
  55. {
  56. rows = data,
  57. total = paginationobj.total,
  58. page = paginationobj.page,
  59. records = paginationobj.records
  60. };
  61. return Success(jsonData);
  62. }
  63. /// <summary>
  64. /// 获取表单数据
  65. /// </summary>
  66. /// <param name="keyValue">主键</param>
  67. /// <returns></returns>
  68. [HttpGet]
  69. [AjaxOnly]
  70. public ActionResult GetFormData(string keyValue)
  71. {
  72. var HiringRegistrationData = hiringRegistrationIBLL.GetHiringRegistrationEntity(keyValue);
  73. var jsonData = new
  74. {
  75. HiringRegistration = HiringRegistrationData,
  76. };
  77. return Success(jsonData);
  78. }
  79. #endregion
  80. #region 提交数据
  81. /// <summary>
  82. /// 删除实体数据
  83. /// </summary>
  84. /// <param name="keyValue">主键</param>
  85. /// <returns></returns>
  86. [HttpPost]
  87. [AjaxOnly]
  88. public ActionResult DeleteForm(string keyValue)
  89. {
  90. hiringRegistrationIBLL.DeleteEntity(keyValue);
  91. return Success("删除成功!");
  92. }
  93. /// <summary>
  94. /// 保存实体数据(新增、修改)
  95. /// </summary>
  96. /// <param name="keyValue">主键</param>
  97. /// <param name="strEntity">实体</param>
  98. /// <returns></returns>
  99. [HttpPost]
  100. [ValidateAntiForgeryToken]
  101. [AjaxOnly]
  102. public ActionResult SaveForm(string keyValue, string strEntity)
  103. {
  104. HiringRegistrationEntity entity = strEntity.ToObject<HiringRegistrationEntity>();
  105. var model = hiringRegistrationIBLL.GetIDCard(entity.IdentityCardNo);
  106. if (string.IsNullOrEmpty(keyValue))
  107. {
  108. if (model != null)
  109. {
  110. return Fail("身份证号已存在!");
  111. }
  112. }
  113. else
  114. {
  115. if (model != null && model.ID != keyValue)
  116. {
  117. return Fail("身份证号已存在!");
  118. }
  119. }
  120. hiringRegistrationIBLL.SaveEntity(keyValue, entity);
  121. return Success("保存成功!");
  122. }
  123. #endregion
  124. }
  125. }