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.

Ass_AssetsInfoController.cs 4.4 KiB

4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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-Ultimate V7.0.0 数字化智慧校园
  10. /// Copyright (c) 2013-2018 北京泉江科技有限公司
  11. /// 创 建:超级管理员
  12. /// 日 期:2019-03-29 11:22
  13. /// 描 述:登记在册资产
  14. /// </summary>
  15. public class Ass_AssetsInfoController : MvcControllerBase
  16. {
  17. private Ass_AssetsInfoIBLL ass_AssetsInfoIBLL = new Ass_AssetsInfoBLL();
  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="queryJson">查询参数</param>
  43. /// <returns></returns>
  44. [HttpGet]
  45. [AjaxOnly]
  46. public ActionResult GetPageList(string pagination, string queryJson)
  47. {
  48. Pagination paginationobj = pagination.ToObject<Pagination>();
  49. var data = ass_AssetsInfoIBLL.GetPageList(paginationobj, queryJson);
  50. var jsonData = new
  51. {
  52. rows = data,
  53. total = paginationobj.total,
  54. page = paginationobj.page,
  55. records = paginationobj.records
  56. };
  57. return Success(jsonData);
  58. }
  59. /// <summary>
  60. /// 获取列表不带分页
  61. /// </summary>
  62. /// <param name="queryJson"></param>
  63. /// <returns></returns>
  64. [HttpGet]
  65. [AjaxOnly]
  66. public ActionResult GetList(string queryJson)
  67. {
  68. var data = ass_AssetsInfoIBLL.GetList(queryJson);
  69. return Success(data);
  70. }
  71. /// <summary>
  72. /// 获取左侧树形数据
  73. /// <summary>
  74. /// <returns></returns>
  75. [HttpGet]
  76. [AjaxOnly]
  77. public ActionResult GetTree()
  78. {
  79. var data = ass_AssetsInfoIBLL.GetTree();
  80. return Success(data);
  81. }
  82. /// <summary>
  83. /// 获取表单数据
  84. /// <summary>
  85. /// <returns></returns>
  86. [HttpGet]
  87. [AjaxOnly]
  88. public ActionResult GetFormData(string keyValue)
  89. {
  90. var Ass_AssetsInfoData = ass_AssetsInfoIBLL.GetAss_AssetsInfoEntity( keyValue );
  91. var jsonData = new {
  92. Ass_AssetsInfo = Ass_AssetsInfoData,
  93. };
  94. return Success(jsonData);
  95. }
  96. [HttpPost]
  97. [AjaxOnly]
  98. public ActionResult GetFormDataByCode(string code)
  99. {
  100. var Ass_AssetsInfoData = ass_AssetsInfoIBLL.GetAss_AssetsInfoEntityByCode( code );
  101. var jsonData = new {
  102. Ass_AssetsInfo = Ass_AssetsInfoData,
  103. };
  104. return Success(jsonData);
  105. }
  106. #endregion
  107. #region 提交数据
  108. /// <summary>
  109. /// 删除实体数据
  110. /// <param name="keyValue">主键</param>
  111. /// <summary>
  112. /// <returns></returns>
  113. [HttpPost]
  114. [AjaxOnly]
  115. public ActionResult DeleteForm(string keyValue)
  116. {
  117. ass_AssetsInfoIBLL.DeleteEntity(keyValue);
  118. return Success("删除成功!");
  119. }
  120. public ActionResult ArrangementAss()
  121. {
  122. ass_AssetsInfoIBLL.ArrangementAss();
  123. return Success("整理成功");
  124. }
  125. /// <summary>
  126. /// 保存实体数据(新增、修改)
  127. /// <param name="keyValue">主键</param>
  128. /// <summary>
  129. /// <returns></returns>
  130. [HttpPost]
  131. [ValidateAntiForgeryToken]
  132. [AjaxOnly]
  133. public ActionResult SaveForm(string keyValue, string strEntity)
  134. {
  135. Ass_AssetsInfoEntity entity = strEntity.ToObject<Ass_AssetsInfoEntity>();
  136. ass_AssetsInfoIBLL.SaveEntity(keyValue,entity);
  137. return Success("保存成功!");
  138. }
  139. #endregion
  140. }
  141. }