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.
 
 
 
 
 
 

154 lines
4.6 KiB

  1. using Learun.Util;
  2. using System.Data;
  3. using Learun.Application.TwoDevelopment.CustomFunction;
  4. using System.Web.Mvc;
  5. using System.Collections.Generic;
  6. namespace Learun.Application.Web.Areas.CustomFunction.Controllers
  7. {
  8. /// <summary>
  9. /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
  10. /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  11. /// 创 建:超级管理员
  12. /// 日 期:2021-09-27 11:38
  13. /// 描 述:经费预算管理
  14. /// </summary>
  15. public class FundsManageMainController : MvcControllerBase
  16. {
  17. private FundsManageMainIBLL fundsManageMainIBLL = new FundsManageMainBLL();
  18. private FundsManageChildIBLL fundsManageChildIBLL = new FundsManageChildBLL();
  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. /// <summary>
  39. /// 表单页
  40. /// <summary>
  41. /// <returns></returns>
  42. [HttpGet]
  43. public ActionResult IndexCheck()
  44. {
  45. return View();
  46. }
  47. /// <summary>
  48. /// 统计
  49. /// <summary>
  50. /// <returns></returns>
  51. [HttpGet]
  52. public ActionResult IndexStatistics()
  53. {
  54. return View();
  55. }
  56. #endregion
  57. #region 获取数据
  58. /// <summary>
  59. /// 获取页面显示列表数据
  60. /// </summary>
  61. /// <param name="pagination">分页参数</param>
  62. /// <param name="queryJson">查询参数</param>
  63. /// <returns></returns>
  64. [HttpGet]
  65. [AjaxOnly]
  66. public ActionResult GetPageList(string pagination, string queryJson)
  67. {
  68. Pagination paginationobj = pagination.ToObject<Pagination>();
  69. var data = fundsManageMainIBLL.GetPageList(paginationobj, queryJson);
  70. var jsonData = new
  71. {
  72. rows = data,
  73. total = paginationobj.total,
  74. page = paginationobj.page,
  75. records = paginationobj.records
  76. };
  77. return Success(jsonData);
  78. }
  79. /// <summary>
  80. /// 获取表单数据
  81. /// </summary>
  82. /// <param name="keyValue">主键</param>
  83. /// <returns></returns>
  84. [HttpGet]
  85. [AjaxOnly]
  86. public ActionResult GetFormData(string keyValue)
  87. {
  88. var FundsManageMainData = fundsManageMainIBLL.GetFundsManageMainEntity(keyValue);
  89. var FundsManageChildData = fundsManageChildIBLL.GetListByMainId(keyValue);
  90. var jsonData = new
  91. {
  92. FundsManageMain = FundsManageMainData,
  93. FundsManageChild = FundsManageChildData
  94. };
  95. return Success(jsonData);
  96. }
  97. #endregion
  98. #region 提交数据
  99. /// <summary>
  100. /// 删除实体数据
  101. /// </summary>
  102. /// <param name="keyValue">主键</param>
  103. /// <returns></returns>
  104. [HttpPost]
  105. [AjaxOnly]
  106. public ActionResult DeleteForm(string keyValue)
  107. {
  108. fundsManageMainIBLL.DeleteEntity(keyValue);
  109. return Success("删除成功!");
  110. }
  111. /// <summary>
  112. /// 保存实体数据(新增、修改)
  113. /// </summary>
  114. /// <param name="keyValue">主键</param>
  115. /// <param name="strEntity">实体</param>
  116. /// <returns></returns>
  117. [HttpPost]
  118. [ValidateAntiForgeryToken]
  119. [AjaxOnly]
  120. public ActionResult SaveForm(string keyValue, string strEntity, string FundsManageChildList)
  121. {
  122. FundsManageMainEntity entity = strEntity.ToObject<FundsManageMainEntity>();
  123. entity.Status = 0;
  124. List<FundsManageChildEntity> fundsManageChildList = FundsManageChildList.ToObject<List<FundsManageChildEntity>>();
  125. fundsManageMainIBLL.SaveEntity(keyValue, entity, fundsManageChildList);
  126. return Success("保存成功!");
  127. }
  128. /// <summary>
  129. /// 修改状态
  130. /// </summary>
  131. /// <param name="keyValue">主键</param>
  132. /// <returns></returns>
  133. [HttpPost]
  134. [AjaxOnly]
  135. public ActionResult UpdateStatus(string keyValue,int Status)
  136. {
  137. fundsManageMainIBLL.UpdateStatus(keyValue, Status);
  138. return Success("保存成功!");
  139. }
  140. #endregion
  141. }
  142. }