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.
 
 
 
 
 
 

187 lines
5.5 KiB

  1. using Learun.Util;
  2. using System.Data;
  3. using Learun.Application.TwoDevelopment.LogisticsManagement;
  4. using System.Web.Mvc;
  5. using System.Collections.Generic;
  6. using System;
  7. namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers
  8. {
  9. /// <summary>
  10. /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
  11. /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  12. /// 创 建:超级管理员
  13. /// 日 期:2021-06-21 15:49
  14. /// 描 述:项目资料管理
  15. /// </summary>
  16. public class ProjectDataManageController : MvcControllerBase
  17. {
  18. private ProjectDataManageIBLL projectDataManageIBLL = new ProjectDataManageBLL();
  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 IndexData()
  44. {
  45. return View();
  46. }
  47. /// <summary>
  48. /// 项目资料查看
  49. /// <summary>
  50. /// <returns></returns>
  51. [HttpGet]
  52. public ActionResult IndexView()
  53. {
  54. return View();
  55. }
  56. /// <summary>
  57. /// 项目资料查看
  58. /// <summary>
  59. /// <returns></returns>
  60. [HttpGet]
  61. public ActionResult FormView()
  62. {
  63. return View();
  64. }
  65. #endregion
  66. #region 获取数据
  67. /// <summary>
  68. /// 获取页面显示列表数据
  69. /// </summary>
  70. /// <param name="pagination">分页参数</param>
  71. /// <param name="queryJson">查询参数</param>
  72. /// <returns></returns>
  73. [HttpGet]
  74. [AjaxOnly]
  75. public ActionResult GetPageList(string pagination, string queryJson)
  76. {
  77. Pagination paginationobj = pagination.ToObject<Pagination>();
  78. var data = projectDataManageIBLL.GetPageList(paginationobj, queryJson);
  79. var jsonData = new
  80. {
  81. rows = data,
  82. total = paginationobj.total,
  83. page = paginationobj.page,
  84. records = paginationobj.records
  85. };
  86. return Success(jsonData);
  87. }/// <summary>
  88. /// 获取页面显示列表数据
  89. /// </summary>
  90. /// <param name="pagination">分页参数</param>
  91. /// <param name="queryJson">查询参数</param>
  92. /// <returns></returns>
  93. [HttpGet]
  94. [AjaxOnly]
  95. public ActionResult GetList(string queryJson)
  96. {
  97. var data = projectDataManageIBLL.GetList(queryJson);
  98. return Success(data);
  99. }
  100. /// <summary>
  101. /// 获取表单数据
  102. /// </summary>
  103. /// <param name="keyValue">主键</param>
  104. /// <returns></returns>
  105. [HttpGet]
  106. [AjaxOnly]
  107. public ActionResult GetFormData(string keyValue)
  108. {
  109. var ProjectDataManageData = projectDataManageIBLL.GetProjectDataManageEntity(keyValue);
  110. var jsonData = new
  111. {
  112. ProjectDataManage = ProjectDataManageData,
  113. };
  114. return Success(jsonData);
  115. }
  116. #endregion
  117. #region 提交数据
  118. /// <summary>
  119. /// 删除实体数据
  120. /// </summary>
  121. /// <param name="keyValue">主键</param>
  122. /// <returns></returns>
  123. [HttpPost]
  124. [AjaxOnly]
  125. public ActionResult DeleteForm(string keyValue)
  126. {
  127. projectDataManageIBLL.DeleteEntity(keyValue);
  128. return Success("删除成功!");
  129. }
  130. /// <summary>
  131. /// 保存实体数据(新增、修改)
  132. /// </summary>
  133. /// <param name="keyValue">主键</param>
  134. /// <param name="strEntity">实体</param>
  135. /// <returns></returns>
  136. [HttpPost]
  137. [ValidateAntiForgeryToken]
  138. [AjaxOnly]
  139. public ActionResult SaveForm(string keyValue, string strEntity)
  140. {
  141. ProjectDataManageEntity entity = strEntity.ToObject<ProjectDataManageEntity>();
  142. projectDataManageIBLL.SaveEntity(keyValue, entity);
  143. return Success("保存成功!");
  144. }
  145. /// <summary>
  146. /// 上传项目资料
  147. /// </summary>
  148. /// <param name="keyValue">主键</param>
  149. /// <param name="strEntity">实体</param>
  150. /// <returns></returns>
  151. [HttpPost]
  152. [ValidateAntiForgeryToken]
  153. [AjaxOnly]
  154. public ActionResult SaveData(string keyValue, string strEntity)
  155. {
  156. ProjectDataManageEntity pentity = strEntity.ToObject<ProjectDataManageEntity>();
  157. var entity = projectDataManageIBLL.GetProjectDataManageEntity(keyValue);
  158. entity.Files = pentity.Files;
  159. entity.Name = pentity.Name;
  160. entity.Remark = pentity.Remark;
  161. if (!string.IsNullOrEmpty(entity.Files))
  162. {
  163. entity.FileTime = DateTime.Now;
  164. entity.FileStatus = 1;
  165. }
  166. projectDataManageIBLL.SaveEntity(keyValue, entity);
  167. return Success("保存成功!");
  168. }
  169. #endregion
  170. }
  171. }