WcsDatablockController.cs 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using Microsoft.AspNetCore.Mvc;using WMS.BZWeb;
  6. using WMS.Core;
  7. using WMS.Core.ServiceCore;
  8. using WMS.Info;
  9. namespace WMS.BZWeb
  10. {
  11. [Area("WCSManager")]
  12. public class WcsDatablockController : MvcControllerBase
  13. {
  14. WcsDatablockService bll = new WcsDatablockService();
  15. #region 视图功能
  16. // GET: WCSManager/WcsDatablock
  17. public ActionResult Index()
  18. {
  19. return View();
  20. }
  21. /// <summary>
  22. /// 表单页
  23. /// <summary>
  24. /// <returns></returns>
  25. [HttpGet]
  26. public ActionResult Form()
  27. {
  28. return View();
  29. }
  30. #endregion
  31. #region 获取数据
  32. /// <summary>
  33. /// 分页查询
  34. /// </summary>
  35. /// <param name="pagination">分页参数</param>
  36. /// <param name="queryJson">查询条件函数</param>
  37. /// <returns></returns>
  38. [HttpGet]
  39. ////[AjaxOnly]
  40. public ActionResult GetPageList(string pagination, string queryJson)
  41. {
  42. Pagination paginationobj = InitPagination(pagination);
  43. return ToPageDataResult(paginationobj, bll.GetPageList(paginationobj, queryJson));
  44. }
  45. /// <summary>
  46. ///
  47. /// </summary>
  48. /// <returns></returns>
  49. [HttpGet]
  50. ////[AjaxOnly]
  51. public ActionResult GetSelectDBNameList()
  52. {
  53. return Success( bll.GetSelectDBNameList());
  54. }
  55. /// <summary>
  56. ///
  57. /// </summary>
  58. /// <returns></returns>
  59. [HttpGet]
  60. ////[AjaxOnly]
  61. public ActionResult GetDBNameByPlcCode(string plccode)
  62. {
  63. return Success(bll.GetDBNameByPlcCode(plccode));
  64. }
  65. /// <summary>
  66. /// 获取表单数据
  67. /// <param name="keyValue">主键</param>
  68. /// <summary>
  69. /// <returns></returns>
  70. [HttpGet]
  71. ////[AjaxOnly]
  72. public ActionResult GetFormData(string keyValue)
  73. {
  74. var data = bll.GetEntity(keyValue);
  75. return Success("", data);
  76. }
  77. /// <summary>
  78. /// 删除实体数据
  79. /// <param name="keyValue">主键</param>
  80. /// <summary>
  81. /// <returns></returns>
  82. [HttpPost]
  83. ////[AjaxOnly]
  84. public ActionResult DeleteForm(string keyValue)
  85. {
  86. bll.DeleteEntity(keyValue);
  87. return Success("删除成功。");
  88. }
  89. /// <summary>
  90. /// 保存实体数据(新增、修改)
  91. /// <param name="keyValue">主键</param>
  92. /// <summary>
  93. /// <returns></returns>
  94. [HttpPost]
  95. [ValidateAntiForgeryToken]
  96. ////[AjaxOnly]
  97. public ActionResult SaveForm(string keyValue, WcsDatablockEntity entity)
  98. {
  99. LoginUserInfo LoginUser = LoginBLLCore.GetLoginUser();
  100. bll.SaveEntity(LoginUser, keyValue, entity);
  101. return Success("保存成功!");
  102. }
  103. #endregion;
  104. }
  105. }