WcsPlcController.cs 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. using Microsoft.AspNetCore.Mvc;using WMS.BZWeb;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Web;
  6. using WMS.Core;
  7. using WMS.Core.ServiceCore;
  8. using WMS.Info;
  9. namespace WMS.BZWeb
  10. {
  11. [Area("WCSManager")]
  12. public class WcsPlcController : MvcControllerBase
  13. {
  14. WcsPLCService bll = new WcsPLCService();
  15. #region 视图功能
  16. // GET: WCSManager/WcsPlc
  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 GetSelectPLCNameList()
  52. {
  53. return Success(bll.GetSelectPLCNameList());
  54. }
  55. /// <summary>
  56. /// 获取表单数据
  57. /// <param name="keyValue">主键</param>
  58. /// <summary>
  59. /// <returns></returns>
  60. [HttpGet]
  61. ////[AjaxOnly]
  62. public ActionResult GetFormData(string keyValue)
  63. {
  64. var data = bll.GetEntity(keyValue);
  65. return Success("", data);
  66. }
  67. /// <summary>
  68. /// 删除实体数据
  69. /// <param name="keyValue">主键</param>
  70. /// <summary>
  71. /// <returns></returns>
  72. [HttpPost]
  73. ////[AjaxOnly]
  74. public ActionResult DeleteForm(string keyValue)
  75. {
  76. bll.DeleteEntity(keyValue);
  77. return Success("删除成功。");
  78. }
  79. /// <summary>
  80. /// 保存实体数据(新增、修改)
  81. /// <param name="keyValue">主键</param>
  82. /// <summary>
  83. /// <returns></returns>
  84. [HttpPost]
  85. [ValidateAntiForgeryToken]
  86. ////[AjaxOnly]
  87. public ActionResult SaveForm(string keyValue, WcsPlcEntity entity)
  88. {
  89. LoginUserInfo LoginUser = LoginBLLCore.GetLoginUser();
  90. bll.SaveEntity(LoginUser, keyValue, entity);
  91. return Success("保存成功!");
  92. }
  93. #endregion;
  94. }
  95. }