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.

LeagueMemberController.cs 4.1 KiB

4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. using Learun.Util;
  2. using System.Data;
  3. using Learun.Application.TwoDevelopment.PersonnelManagement;
  4. using System.Web.Mvc;
  5. using System.Collections.Generic;
  6. using System;
  7. using Learun.Application.TwoDevelopment.EducationalAdministration;
  8. namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers
  9. {
  10. /// <summary>
  11. /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
  12. /// Copyright (c) 2013-2018 北京泉江科技有限公司
  13. /// 创 建:超级管理员
  14. /// 日 期:2020-01-04 10:19
  15. /// 描 述:共青团团员
  16. /// </summary>
  17. public class LeagueMemberController : MvcControllerBase
  18. {
  19. private LeagueMemberIBLL leagueMemberIBLL = new LeagueMemberBLL();
  20. private StuInfoBasicIBLL stuInfoBasicIBLL = new StuInfoBasicBLL();
  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. /// <summary>
  41. /// 编辑表单页
  42. /// <summary>
  43. /// <returns></returns>
  44. [HttpGet]
  45. public ActionResult ModifyForm()
  46. {
  47. return View();
  48. }
  49. #endregion
  50. #region 获取数据
  51. /// <summary>
  52. /// 获取页面显示列表数据
  53. /// <summary>
  54. /// <param name="queryJson">查询参数</param>
  55. /// <returns></returns>
  56. [HttpGet]
  57. [AjaxOnly]
  58. public ActionResult GetPageList(string pagination, string queryJson)
  59. {
  60. Pagination paginationobj = pagination.ToObject<Pagination>();
  61. var data = leagueMemberIBLL.GetPageList(paginationobj, queryJson);
  62. var jsonData = new
  63. {
  64. rows = data,
  65. total = paginationobj.total,
  66. page = paginationobj.page,
  67. records = paginationobj.records
  68. };
  69. return Success(jsonData);
  70. }
  71. /// <summary>
  72. /// 获取表单数据
  73. /// <summary>
  74. /// <returns></returns>
  75. [HttpGet]
  76. [AjaxOnly]
  77. public ActionResult GetFormData(string keyValue)
  78. {
  79. var LeagueMemberData = leagueMemberIBLL.GetLeagueMemberEntity(keyValue);
  80. var jsonData = new
  81. {
  82. LeagueMember = LeagueMemberData,
  83. };
  84. return Success(jsonData);
  85. }
  86. #endregion
  87. #region 提交数据
  88. /// <summary>
  89. /// 删除实体数据
  90. /// <param name="keyValue">主键</param>
  91. /// <summary>
  92. /// <returns></returns>
  93. [HttpPost]
  94. [AjaxOnly]
  95. public ActionResult DeleteForm(string keyValue)
  96. {
  97. leagueMemberIBLL.DeleteEntity(keyValue);
  98. return Success("删除成功!");
  99. }
  100. /// <summary>
  101. /// 保存实体数据(新增、修改)
  102. /// <param name="keyValue">主键</param>
  103. /// <summary>
  104. /// <returns></returns>
  105. [HttpPost]
  106. [ValidateAntiForgeryToken]
  107. [AjaxOnly]
  108. public ActionResult SaveForm(string keyValue, string strEntity)
  109. {
  110. var loginInfo = LoginUserInfo.Get();
  111. LeagueMemberEntity entity = strEntity.ToObject<LeagueMemberEntity>();
  112. //var stuEntity = stuInfoBasicIBLL.GetStuInfoBasicEntityByStuNo(entity.StuNo);
  113. //if (stuEntity == null)
  114. //{
  115. // return Fail("学生不存在!");
  116. //}
  117. //entity.StuName = stuEntity.StuName;
  118. if (string.IsNullOrEmpty(keyValue))
  119. {
  120. entity.CreateTime = DateTime.Now;
  121. entity.CreateUserId = loginInfo.userId;
  122. entity.CreateUserName = loginInfo.realName;
  123. }
  124. leagueMemberIBLL.SaveEntity(keyValue, entity);
  125. return Success("保存成功!");
  126. }
  127. #endregion
  128. }
  129. }