public ActionResult Add(Base_Role model) { //权限检查 Helper.IsCheck(HttpContext, AdminModule.AdminRole.ToString(), SystemRight.Add.ToString(), true); ResultView <int> view = new ResultView <int>(); ResultView <bool> checkRight = new ResultView <bool>(); if (string.IsNullOrEmpty(model.RoleName)) { view.Flag = false; view.Message = "角色名不能为空"; return(Json(view)); } model.Belong = RoleType.Owner.ToString(); Result <int> result = new Result <int>(); using (AdminClientProxy proxy = new AdminClientProxy(ProxyEx(Request))) { result = proxy.AddRole(model); view = result.ToResultView(); } return(Json(view)); }
public ActionResult Add(Base_Role model) { ViewBag.Belong = model.Belong; Result <int> result = new Result <int>(); ResultView <int> view = new ResultView <int>(); if (string.IsNullOrEmpty(model.RoleName)) { view.Flag = false; view.Message = "角色名不能为空"; return(Json(view)); } using (AdminClientProxy proxy = new AdminClientProxy(ProxyEx(Request))) { result = proxy.AddRole(model); view = result.ToResultView(); } return(Json(view)); }