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.

StockDemoController.cs 3.8 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. using Learun.Util;
  2. using System.Data;
  3. using Learun.Application.TwoDevelopment.LR_CodeDemo;
  4. using System.Web.Mvc;
  5. using System.Collections.Generic;
  6. namespace Learun.Application.Web.Areas.LR_CodeDemo.Controllers
  7. {
  8. /// <summary>
  9. /// 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架
  10. /// Copyright (c) 2013-2018 上海力软信息技术有限公司
  11. /// 创 建:超级管理员
  12. /// 日 期:2019-06-12 18:49
  13. /// 描 述:库存
  14. /// </summary>
  15. public class StockDemoController : MvcControllerBase
  16. {
  17. private StockDemoIBLL stockDemoIBLL = new StockDemoBLL();
  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. /// <summary>
  38. /// 库存页
  39. /// <summary>
  40. /// <returns></returns>
  41. [HttpGet]
  42. public ActionResult Stock()
  43. {
  44. return View();
  45. }
  46. #endregion
  47. #region 获取数据
  48. /// <summary>
  49. /// 获取页面显示列表数据
  50. /// <summary>
  51. /// <param name="queryJson">查询参数</param>
  52. /// <returns></returns>
  53. [HttpGet]
  54. [AjaxOnly]
  55. public ActionResult GetPageList(string pagination, string queryJson)
  56. {
  57. Pagination paginationobj = pagination.ToObject<Pagination>();
  58. var data = stockDemoIBLL.GetPageList(paginationobj, queryJson);
  59. var jsonData = new
  60. {
  61. rows = data,
  62. total = paginationobj.total,
  63. page = paginationobj.page,
  64. records = paginationobj.records
  65. };
  66. return Success(jsonData);
  67. }
  68. /// <summary>
  69. /// 获取页面显示列表数据
  70. /// <summary>
  71. /// <param name="queryJson">查询参数</param>
  72. /// <returns></returns>
  73. [HttpGet]
  74. [AjaxOnly]
  75. public ActionResult GetStock(string stockArea)
  76. {
  77. var data = stockDemoIBLL.GetStock(stockArea);
  78. return Success(data);
  79. }
  80. /// <summary>
  81. /// 获取表单数据
  82. /// <summary>
  83. /// <returns></returns>
  84. [HttpGet]
  85. [AjaxOnly]
  86. public ActionResult GetFormData(string keyValue)
  87. {
  88. var LR_Demo_StockData = stockDemoIBLL.GetLR_Demo_StockEntity( keyValue );
  89. var jsonData = new {
  90. LR_Demo_Stock = LR_Demo_StockData,
  91. };
  92. return Success(jsonData);
  93. }
  94. #endregion
  95. #region 提交数据
  96. /// <summary>
  97. /// 删除实体数据
  98. /// <param name="keyValue">主键</param>
  99. /// <summary>
  100. /// <returns></returns>
  101. [HttpPost]
  102. [AjaxOnly]
  103. public ActionResult DeleteForm(string keyValue)
  104. {
  105. stockDemoIBLL.DeleteEntity(keyValue);
  106. return Success("删除成功!");
  107. }
  108. /// <summary>
  109. /// 保存实体数据(新增、修改)
  110. /// <param name="keyValue">主键</param>
  111. /// <summary>
  112. /// <returns></returns>
  113. [HttpPost]
  114. [ValidateAntiForgeryToken]
  115. [AjaxOnly]
  116. public ActionResult SaveForm(string keyValue, string strEntity)
  117. {
  118. LR_Demo_StockEntity entity = strEntity.ToObject<LR_Demo_StockEntity>();
  119. stockDemoIBLL.SaveEntity(keyValue,entity);
  120. if (string.IsNullOrEmpty(keyValue))
  121. {
  122. }
  123. return Success("保存成功!");
  124. }
  125. #endregion
  126. }
  127. }