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.
 
 
 
 
 
 

123 lines
3.8 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-09-09 11:42
  13. /// 描 述:公开选调工作人员报名表
  14. /// </summary>
  15. public class WorkStaffController : MvcControllerBase
  16. {
  17. private WorkStaffIBLL workStaffIBLL = new WorkStaffBLL();
  18. private WorkStaffSonIBLL workStaffSonIBLL = new WorkStaffSonBLL();
  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="pagination">分页参数</param>
  44. /// <param name="queryJson">查询参数</param>
  45. /// <returns></returns>
  46. [HttpGet]
  47. [AjaxOnly]
  48. public ActionResult GetPageList(string pagination, string queryJson)
  49. {
  50. Pagination paginationobj = pagination.ToObject<Pagination>();
  51. var data = workStaffIBLL.GetPageList(paginationobj, queryJson);
  52. var jsonData = new
  53. {
  54. rows = data,
  55. total = paginationobj.total,
  56. page = paginationobj.page,
  57. records = paginationobj.records
  58. };
  59. return Success(jsonData);
  60. }
  61. /// <summary>
  62. /// 获取表单数据
  63. /// </summary>
  64. /// <param name="keyValue">主键</param>
  65. /// <returns></returns>
  66. [HttpGet]
  67. [AjaxOnly]
  68. public ActionResult GetFormData(string keyValue)
  69. {
  70. var WorkStaffData = workStaffIBLL.GetWorkStaffEntity(keyValue);
  71. var WorkStaffSonData = workStaffSonIBLL.GetByStaffId(WorkStaffData.ID);
  72. var jsonData = new
  73. {
  74. WorkStaff = WorkStaffData,
  75. WorkStaffSon = WorkStaffSonData
  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. workStaffIBLL.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, string WorkStaffSonList)
  103. {
  104. WorkStaffEntity entity = strEntity.ToObject<WorkStaffEntity>();
  105. if (string.IsNullOrEmpty(keyValue))
  106. {
  107. }
  108. List<WorkStaffSonEntity> WorkStaffSonntitEntity = WorkStaffSonList.ToObject<List<WorkStaffSonEntity>>();
  109. workStaffIBLL.SaveEntity(keyValue, entity, WorkStaffSonntitEntity);
  110. return Success("保存成功!");
  111. }
  112. #endregion
  113. }
  114. }