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
2.0 KiB

  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 GetGridJsonFY(Pagination pagination, string keyword)
  18. {
  19. var data = roleApp.GetList(pagination,keyword );
  20. var JsonData = new
  21. {
  22. total = pagination.total,
  23. page = pagination.page,
  24. records = pagination.records,
  25. rows = data
  26. };
  27. return Content(JsonData.ToJson());
  28. }
  29. [HttpGet]
  30. [HandlerAjaxOnly]
  31. public ActionResult GetGridJson( string keyword)
  32. {
  33. var data = roleApp.GetList( keyword);
  34. return Content(data.ToJson());
  35. }
  36. [HttpGet]
  37. [HandlerAjaxOnly]
  38. public ActionResult GetFormJson(string keyValue)
  39. {
  40. var data = roleApp.GetForm(keyValue);
  41. return Content(data.ToJson());
  42. }
  43. [HttpPost]
  44. [HandlerAjaxOnly]
  45. [ValidateAntiForgeryToken]
  46. public ActionResult SubmitForm(RoleEntity roleEntity, string permissionIds, string keyValue)
  47. {
  48. roleApp.SubmitForm(roleEntity, permissionIds.Split(','), keyValue);
  49. return Success("操作成功。");
  50. }
  51. [HttpPost]
  52. [HandlerAjaxOnly]
  53. [HandlerAuthorize]
  54. [ValidateAntiForgeryToken]
  55. public ActionResult DeleteForm(string keyValue)
  56. {
  57. roleApp.DeleteForm(keyValue);
  58. return Success("删除成功。");
  59. }
  60. }
  61. }