using NFine.Application.SystemManage; using NFine.Code; using NFine.Domain.Entity.SystemManage; using System.Collections.Generic; using System.Data; using System.Linq; using System.Web.Mvc; namespace NFine.Web.Areas.SystemManage.Controllers { public class RoleController : ControllerBase { private RoleApp roleApp = new RoleApp(); private RoleAuthorizeApp roleAuthorizeApp = new RoleAuthorizeApp(); private ModuleApp moduleApp = new ModuleApp(); private ModuleButtonApp moduleButtonApp = new ModuleButtonApp(); [HttpGet] [HandlerAjaxOnly] public ActionResult GetGridJson(string keyword) { var data = roleApp.GetList(keyword); return Content(data.ToJson()); } [HttpGet] [HandlerAjaxOnly] public ActionResult GetFormJson(string keyValue) { var data = roleApp.GetForm(keyValue); return Content(data.ToJson()); } [HttpPost] [HandlerAjaxOnly] [ValidateAntiForgeryToken] public ActionResult SubmitForm(RoleEntity roleEntity, string permissionIds, string keyValue) { roleApp.SubmitForm(roleEntity, permissionIds.Split(','), keyValue); return Success("操作成功。"); } [HttpPost] [HandlerAjaxOnly] [HandlerAuthorize] [ValidateAntiForgeryToken] public ActionResult DeleteForm(string keyValue) { roleApp.DeleteForm(keyValue); return Success("删除成功。"); } public ActionResult GetRole() { DataTable dt = roleApp.GetRole(); return Content(dt.ToJson()); } public ActionResult SubmitFormCloneRole(string keyValue) { int i = roleApp.SubmitFormCloneRole(keyValue); if (i > 0) { return Success("生成成功!"); } else { return Error("生成失败!"); } } } }