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

52 lines
1.5 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 RoleController : ControllerBase
  10. {
  11. private RoleApp roleApp = new RoleApp();
  12. private RoleAuthorizeApp roleAuthorizeApp = new RoleAuthorizeApp();
  13. private ModuleApp moduleApp = new ModuleApp();
  14. private ModuleButtonApp moduleButtonApp = new ModuleButtonApp();
  15. [HttpGet]
  16. [HandlerAjaxOnly]
  17. public ActionResult GetGridJson(string keyword)
  18. {
  19. var data = roleApp.GetList(keyword);
  20. return Content(data.ToJson());
  21. }
  22. [HttpGet]
  23. [HandlerAjaxOnly]
  24. public ActionResult GetFormJson(string keyValue)
  25. {
  26. var data = roleApp.GetForm(keyValue);
  27. return Content(data.ToJson());
  28. }
  29. [HttpPost]
  30. [HandlerAjaxOnly]
  31. [ValidateAntiForgeryToken]
  32. public ActionResult SubmitForm(RoleEntity roleEntity, string permissionIds, string keyValue)
  33. {
  34. roleApp.SubmitForm(roleEntity, permissionIds.Split(','), keyValue);
  35. return Success("操作成功。");
  36. }
  37. [HttpPost]
  38. [HandlerAjaxOnly]
  39. [HandlerAuthorize]
  40. [ValidateAntiForgeryToken]
  41. public ActionResult DeleteForm(string keyValue)
  42. {
  43. roleApp.DeleteForm(keyValue);
  44. return Success("删除成功。");
  45. }
  46. }
  47. }