纽威
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.

55 lines
1.6 KiB

3 years ago
  1. using NFine.Application.ProductManage;
  2. using NFine.Code;
  3. using NFine.Domain.Entity.ProductManage;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Web.Mvc;
  7. namespace NFine.Web.Areas.ProductManage.Controllers
  8. {
  9. public class MaintainController : ControllerBase
  10. {
  11. private MaintainApp maintainAppApp = new MaintainApp();
  12. [HttpGet]
  13. [HandlerAjaxOnly]
  14. public ActionResult GetGridJson(Pagination pagination, string queryJson)
  15. {
  16. var data = new
  17. {
  18. rows = maintainAppApp.GetList(pagination, queryJson),
  19. total = pagination.total,
  20. page = pagination.page,
  21. records = pagination.records
  22. };
  23. return Content(data.ToJson());
  24. }
  25. [HttpGet]
  26. [HandlerAjaxOnly]
  27. public ActionResult GetFormJson(string keyValue)
  28. {
  29. var data = maintainAppApp.GetForm(keyValue);
  30. return Content(data.ToJson());
  31. }
  32. [HttpPost]
  33. [HandlerAjaxOnly]
  34. [ValidateAntiForgeryToken]
  35. public ActionResult SubmitForm(ICSProductEntity productEntity, string keyValue)
  36. {
  37. maintainAppApp.SubmitForm(productEntity, keyValue);
  38. return Success("Successful operation.");
  39. }
  40. [HttpPost]
  41. [HandlerAjaxOnly]
  42. [HandlerAuthorize]
  43. [ValidateAntiForgeryToken]
  44. public ActionResult DeleteForm(string keyValue)
  45. {
  46. maintainAppApp.DeleteForm(keyValue);
  47. return Success("Delete success.");
  48. }
  49. }
  50. }