public JsonResult Add(Domain.Dto.Sys_RolesDto role) { if (!string.IsNullOrEmpty(role.Description)) { var model = new iPow.Infrastructure.Data.DataSys.Sys_Roles(); model.Description = role.Description; model.RoleID = roleService.GetNewRoleId(); roleService.Add(model, null); } var data = this.GetStateTrueList(); var dto = data.ToDto(); return(Json(dto, JsonRequestBehavior.AllowGet)); }
public JsonResult Edit(Domain.Dto.Sys_RolesDto role) { if (role != null && !string.IsNullOrEmpty(role.Description)) { var model = roleService.Get(role.Id); model.Description = role.Description; try { roleService.Modify(model, null); } catch { } } var data = this.GetStateTrueList(); var dto = data.ToDto(); return(Json(dto, JsonRequestBehavior.AllowGet)); }