/// <summary> /// 获取详细 /// </summary> /// <param name="dto"></param> /// <returns></returns> public PublicResult <RoleDetailApo> GetRoleDetail(GetRoleDetailDto dto) { Role role = null; using (var client = DbFactory.CreateClient()) { role = client.Queryable <Role>().InSingle(dto.Id); } if (role == null) { return(Error("找不到数据")); } var res = new RoleDetailApo { Id = role.Id, Name = role.Name, IsActive = role.IsActive, Code = role.Code, IsAdmin = role.IsAdmin, IsSystem = role.IsSystem }; return(res); }
public IActionResult Update(GetRoleDetailDto dto) { var result = _roleService.GetRoleDetail(dto); if (result.Code > 0) { return(Json(result)); } var model = new UpdateModel() { Role = result.Data }; return(View("~/Administration/Views/Role/Update.cshtml", model)); }