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.
 
 
 
 
 
 

143 lines
4.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. namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers
  7. {
  8. /// <summary>
  9. /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
  10. /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  11. /// 创 建:超级管理员
  12. /// 日 期:2021-05-11 14:32
  13. /// 描 述:库房的房间号
  14. /// </summary>
  15. public class AssStorageRoomController : MvcControllerBase
  16. {
  17. private AssStorageRoomIBLL assStorageRoomIBLL = new AssStorageRoomBLL();
  18. #region 视图功能
  19. /// <summary>
  20. /// 主页面
  21. /// <summary>
  22. /// <returns></returns>
  23. [HttpGet]
  24. public ActionResult Index()
  25. {
  26. return View();
  27. }
  28. /// <summary>
  29. /// 表单页
  30. /// <summary>
  31. /// <returns></returns>
  32. [HttpGet]
  33. public ActionResult Form()
  34. {
  35. return View();
  36. }
  37. #endregion
  38. #region 获取数据
  39. /// <summary>
  40. /// 获取页面显示列表数据
  41. /// </summary>
  42. /// <param name="pagination">分页参数</param>
  43. /// <param name="queryJson">查询参数</param>
  44. /// <returns></returns>
  45. [HttpGet]
  46. [AjaxOnly]
  47. public ActionResult GetPageList(string pagination, string queryJson)
  48. {
  49. Pagination paginationobj = pagination.ToObject<Pagination>();
  50. var data = assStorageRoomIBLL.GetPageList(paginationobj, queryJson);
  51. var jsonData = new
  52. {
  53. rows = data,
  54. total = paginationobj.total,
  55. page = paginationobj.page,
  56. records = paginationobj.records
  57. };
  58. return Success(jsonData);
  59. }
  60. /// <summary>
  61. /// 获取表单数据
  62. /// </summary>
  63. /// <param name="keyValue">主键</param>
  64. /// <returns></returns>
  65. [HttpGet]
  66. [AjaxOnly]
  67. public ActionResult GetFormData(string keyValue)
  68. {
  69. var Ass_Storage_RoomData = assStorageRoomIBLL.GetAss_Storage_RoomEntity( keyValue );
  70. var jsonData = new {
  71. Ass_Storage_Room = Ass_Storage_RoomData,
  72. };
  73. return Success(jsonData);
  74. }
  75. /// <summary>
  76. /// 获取左侧树形数据
  77. /// <summary>
  78. /// <returns></returns>
  79. [HttpGet]
  80. [AjaxOnly]
  81. public ActionResult GetTree()
  82. {
  83. var data = assStorageRoomIBLL.GetTree();
  84. return Success(data);
  85. }
  86. /// <summary>
  87. /// 获取房间
  88. /// </summary>
  89. /// <param name="storageId">库房Id</param>
  90. /// <returns></returns>
  91. [HttpGet]
  92. [AjaxOnly]
  93. public ActionResult GetListForStorageId(string storageId)
  94. {
  95. var data = assStorageRoomIBLL.GetListForStorageId(storageId);
  96. return JsonResult(data);
  97. }
  98. #endregion
  99. #region 提交数据
  100. /// <summary>
  101. /// 删除实体数据
  102. /// </summary>
  103. /// <param name="keyValue">主键</param>
  104. /// <returns></returns>
  105. [HttpPost]
  106. [AjaxOnly]
  107. public ActionResult DeleteForm(string keyValue)
  108. {
  109. assStorageRoomIBLL.DeleteEntity(keyValue);
  110. return Success("删除成功!");
  111. }
  112. /// <summary>
  113. /// 保存实体数据(新增、修改)
  114. /// </summary>
  115. /// <param name="keyValue">主键</param>
  116. /// <param name="strEntity">实体</param>
  117. /// <returns></returns>
  118. [HttpPost]
  119. [ValidateAntiForgeryToken]
  120. [AjaxOnly]
  121. public ActionResult SaveForm(string keyValue, string strEntity)
  122. {
  123. Ass_Storage_RoomEntity entity = strEntity.ToObject<Ass_Storage_RoomEntity>();
  124. assStorageRoomIBLL.SaveEntity(keyValue,entity);
  125. if (string.IsNullOrEmpty(keyValue))
  126. {
  127. }
  128. return Success("保存成功!");
  129. }
  130. #endregion
  131. }
  132. }