Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 
 
 
 

201 řádky
6.2 KiB

  1. using Learun.Util;
  2. using System.Data;
  3. using Learun.Application.TwoDevelopment.AssetManagementSystem;
  4. using System.Web.Mvc;
  5. using System.Collections.Generic;
  6. using System;
  7. namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers
  8. {
  9. /// <summary>
  10. /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
  11. /// Copyright (c) 2013-2018 北京泉江科技有限公司
  12. /// 创 建:超级管理员
  13. /// 日 期:2019-03-25 12:00
  14. /// 描 述:入库申请
  15. /// </summary>
  16. public class Ass_AssetsInfoApplyController : MvcControllerBase
  17. {
  18. private Ass_AssetsInfoApplyIBLL ass_AssetsInfoApplyIBLL = new Ass_AssetsInfoApplyBLL();
  19. #region 视图功能
  20. /// <summary>
  21. /// 主页面
  22. /// <summary>
  23. /// <returns></returns>
  24. [HttpGet]
  25. public ActionResult Index()
  26. {
  27. return View();
  28. }
  29. [HttpGet]
  30. public ActionResult IndexJY()
  31. {
  32. return View();
  33. }
  34. [HttpGet]
  35. public ActionResult IndexJYHC()
  36. {
  37. return View();
  38. }
  39. /// <summary>
  40. /// 表单查看页
  41. /// <summary>
  42. /// <returns></returns>
  43. [HttpGet]
  44. public ActionResult FormView()
  45. {
  46. return View();
  47. }
  48. [HttpGet]
  49. public ActionResult FormViewJY()
  50. {
  51. return View();
  52. }
  53. /// <summary>
  54. /// 表单页
  55. /// <summary>
  56. /// <returns></returns>
  57. [HttpGet]
  58. public ActionResult Form()
  59. {
  60. ViewBag.AACode = "RKSQ_" + CommonHelper.CreateNo();
  61. return View();
  62. }
  63. [HttpGet]
  64. public ActionResult FormJY()
  65. {
  66. ViewBag.AACode = "RKSQ_" + CommonHelper.CreateNo();
  67. return View();
  68. }
  69. [HttpGet]
  70. public ActionResult FormJYHC()
  71. {
  72. ViewBag.AACode = "RKSQ_" + CommonHelper.CreateNo();
  73. return View();
  74. }
  75. /// <summary>
  76. /// 采购入库表单页
  77. /// </summary>
  78. /// <returns></returns>
  79. [HttpGet]
  80. public ActionResult FormPurchase()
  81. {
  82. ViewBag.AACode = "RKSQ_" + CommonHelper.CreateNo();
  83. return View();
  84. }
  85. [HttpGet]
  86. public ActionResult FormPurchaseJY()
  87. {
  88. ViewBag.AACode = "RKSQ_" + CommonHelper.CreateNo();
  89. return View();
  90. }
  91. #endregion
  92. #region 获取数据
  93. /// <summary>
  94. /// 获取页面显示列表数据
  95. /// <summary>
  96. /// <param name="queryJson">查询参数</param>
  97. /// <returns></returns>
  98. [HttpGet]
  99. [AjaxOnly]
  100. public ActionResult GetPageList(string pagination, string queryJson)
  101. {
  102. Pagination paginationobj = pagination.ToObject<Pagination>();
  103. var data = ass_AssetsInfoApplyIBLL.GetPageList(paginationobj, queryJson);
  104. var jsonData = new
  105. {
  106. rows = data,
  107. total = paginationobj.total,
  108. page = paginationobj.page,
  109. records = paginationobj.records
  110. };
  111. return Success(jsonData);
  112. }
  113. /// <summary>
  114. /// 获取表单数据
  115. /// <summary>
  116. /// <returns></returns>
  117. [HttpGet]
  118. [AjaxOnly]
  119. public ActionResult GetFormData(string keyValue)
  120. {
  121. var Ass_AssetsInfoApplyData = ass_AssetsInfoApplyIBLL.GetAss_AssetsInfoApplyEntity(keyValue);
  122. var Ass_AssetsInfoItemApplyData = ass_AssetsInfoApplyIBLL.GetAss_AssetsInfoItemApplyList(Ass_AssetsInfoApplyData.AAId);
  123. var jsonData = new
  124. {
  125. Ass_AssetsInfoApply = Ass_AssetsInfoApplyData,
  126. Ass_AssetsInfoItemApply = Ass_AssetsInfoItemApplyData,
  127. };
  128. return Success(jsonData);
  129. }
  130. /// <summary>
  131. /// 获取表单数据
  132. /// <summary>
  133. /// <returns></returns>
  134. [HttpGet]
  135. [AjaxOnly]
  136. public ActionResult GetFormDataByProcessId(string processId)
  137. {
  138. var Ass_AssetsInfoApplyData = ass_AssetsInfoApplyIBLL.GetEntityByProcessId(processId);
  139. var Ass_AssetsInfoItemApplyData = ass_AssetsInfoApplyIBLL.GetAss_AssetsInfoItemApplyList(Ass_AssetsInfoApplyData.AAId);
  140. var jsonData = new
  141. {
  142. Ass_AssetsInfoApply = Ass_AssetsInfoApplyData,
  143. Ass_AssetsInfoItemApply = Ass_AssetsInfoItemApplyData,
  144. };
  145. return Success(jsonData);
  146. }
  147. #endregion
  148. #region 提交数据
  149. /// <summary>
  150. /// 删除实体数据
  151. /// <param name="keyValue">主键</param>
  152. /// <summary>
  153. /// <returns></returns>
  154. [HttpPost]
  155. [AjaxOnly]
  156. public ActionResult DeleteForm(string keyValue)
  157. {
  158. ass_AssetsInfoApplyIBLL.DeleteEntity(keyValue);
  159. return Success("删除成功!");
  160. }
  161. /// <summary>
  162. /// 保存实体数据(新增、修改)
  163. /// <param name="keyValue">主键</param>
  164. /// <summary>
  165. /// <returns></returns>
  166. [HttpPost]
  167. [ValidateAntiForgeryToken]
  168. [AjaxOnly]
  169. public ActionResult SaveForm(string keyValue, string strEntity, string strass_AssetsInfoItemApplyList)
  170. {
  171. Ass_AssetsInfoApplyEntity entity = strEntity.ToObject<Ass_AssetsInfoApplyEntity>();
  172. entity.AAStatus = 0;
  173. entity.AACreateTime = DateTime.Now;
  174. List<Ass_AssetsInfoItemApplyEntity> ass_AssetsInfoItemApplyList = strass_AssetsInfoItemApplyList.ToObject<List<Ass_AssetsInfoItemApplyEntity>>();
  175. ass_AssetsInfoApplyIBLL.SaveEntity(keyValue, entity, ass_AssetsInfoItemApplyList);
  176. return Success("保存成功!");
  177. }
  178. /// <summary>
  179. /// 提交入库申请
  180. /// </summary>
  181. /// <param name="keyValue"></param>
  182. /// <returns></returns>
  183. [HttpPost]
  184. [AjaxOnly]
  185. public ActionResult ChangeStatusById(string keyValue, string processId)
  186. {
  187. ass_AssetsInfoApplyIBLL.ChangeStatusById(keyValue, 1, processId);
  188. return Success("操作成功!");
  189. }
  190. #endregion
  191. }
  192. }