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.

75 lines
2.0 KiB

4 days ago
  1. using NFine.Application.SystemManage;
  2. using NFine.Code;
  3. using NFine.Domain.Entity.SystemManage;
  4. using System.Collections.Generic;
  5. using System.Data;
  6. using System.Linq;
  7. using System.Web.Mvc;
  8. namespace NFine.Web.Areas.SystemManage.Controllers
  9. {
  10. public class RoleController : ControllerBase
  11. {
  12. private RoleApp roleApp = new RoleApp();
  13. private RoleAuthorizeApp roleAuthorizeApp = new RoleAuthorizeApp();
  14. private ModuleApp moduleApp = new ModuleApp();
  15. private ModuleButtonApp moduleButtonApp = new ModuleButtonApp();
  16. [HttpGet]
  17. [HandlerAjaxOnly]
  18. public ActionResult GetGridJson(string keyword)
  19. {
  20. var data = roleApp.GetList(keyword);
  21. return Content(data.ToJson());
  22. }
  23. [HttpGet]
  24. [HandlerAjaxOnly]
  25. public ActionResult GetFormJson(string keyValue)
  26. {
  27. var data = roleApp.GetForm(keyValue);
  28. return Content(data.ToJson());
  29. }
  30. [HttpPost]
  31. [HandlerAjaxOnly]
  32. [ValidateAntiForgeryToken]
  33. public ActionResult SubmitForm(RoleEntity roleEntity, string permissionIds, string keyValue)
  34. {
  35. roleApp.SubmitForm(roleEntity, permissionIds.Split(','), keyValue);
  36. return Success("操作成功。");
  37. }
  38. [HttpPost]
  39. [HandlerAjaxOnly]
  40. [HandlerAuthorize]
  41. [ValidateAntiForgeryToken]
  42. public ActionResult DeleteForm(string keyValue)
  43. {
  44. roleApp.DeleteForm(keyValue);
  45. return Success("删除成功。");
  46. }
  47. public ActionResult GetRole()
  48. {
  49. DataTable dt = roleApp.GetRole();
  50. return Content(dt.ToJson());
  51. }
  52. public ActionResult SubmitFormCloneRole(string keyValue)
  53. {
  54. int i = roleApp.SubmitFormCloneRole(keyValue);
  55. if (i > 0)
  56. {
  57. return Success("生成成功!");
  58. }
  59. else
  60. {
  61. return Error("生成失败!");
  62. }
  63. }
  64. }
  65. }