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

68 lines
1.8 KiB

3 years ago
  1. using NFine.Application.SystemManage;
  2. using NFine.Code;
  3. using NFine.Domain.Entity.SystemManage;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Web.Mvc;
  7. namespace NFine.Web.Areas.SystemManage.Controllers
  8. {
  9. public class CustomerController : ControllerBase
  10. {
  11. private CustomerApp cusApp = new CustomerApp();
  12. [HttpGet]
  13. [HandlerAjaxOnly]
  14. public ActionResult GetGridJson(Pagination pagination, string keyword)
  15. {
  16. var data = new
  17. {
  18. rows = cusApp.GetList(pagination, keyword),
  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 = cusApp.GetForm(keyValue);
  30. return Content(data.ToJson());
  31. }
  32. public ActionResult GetFormJsonCus()
  33. {
  34. var data = cusApp.GetListCus();
  35. return Content(data.ToJson());
  36. }
  37. [HttpPost]
  38. [HandlerAjaxOnly]
  39. [ValidateAntiForgeryToken]
  40. public ActionResult SubmitForm(CustomerEntity cusEntity, string keyValue)
  41. {
  42. cusApp.SubmitForm(cusEntity, keyValue);
  43. return Success("操作成功。");
  44. }
  45. [HttpPost]
  46. [HandlerAuthorize]
  47. [HandlerAjaxOnly]
  48. [ValidateAntiForgeryToken]
  49. public ActionResult DeleteForm(string keyValue)
  50. {
  51. cusApp.DeleteForm(keyValue);
  52. return Success("删除成功。");
  53. }
  54. [HttpGet]
  55. public ActionResult Info()
  56. {
  57. return View();
  58. }
  59. }
  60. }