public void OnGet(Guid id) { SysUser = _sysUserService.GetUserMapping(id); var userRoles = _sysRoleService.GetUserRoles(); UserRoles = userRoles.Where(o => o.UserId == id).Distinct().ToList(); Roles = _sysRoleService.GetRoles(); }
/// <summary> /// /// </summary> /// <returns></returns> public async Task <IViewComponentResult> InvokeAsync() { var roles = _sysRoleService.GetRoles(); await Task.FromResult(0); return(View(roles)); }
public void OnGet(Guid?id = null) { if (id.HasValue) { SysUser = _sysUserService.GetUserMapping(id.Value); var userRoles = _sysRoleService.GetUserRoles(); UserRoles = userRoles.Where(o => o.UserId == id.Value).Distinct().ToList(); } Roles = _sysRoleService.GetRoles(); }
public IActionResult UserEdit(Guid?id) { Sys_UserMapping model = null; ViewBag.Roles = _sysRoleService.GetRoles(); if (id.HasValue) { model = _sysUserService.GetUserMapping(id.Value); if (model != null) { var userRoles = _sysRoleService.GetUserRoles(); model.UserRoles = userRoles.Where(o => o.UserId == id.Value).Distinct().ToList(); } } if (model == null) { model = new Sys_UserMapping(); } return(PartialView(model)); }
public IActionResult UserEdit(string id) { Sys_UserMapping model = null; ViewBag.Roles = _sysRoleService.GetRoles(); if (!String.IsNullOrEmpty(id)) { model = _sysUserService.GetUserMapping(id); if (model != null) { var userRoles = _sysRoleService.GetUserRoles(); model.UserRoles = userRoles.Where(o => o.user_id == id).Distinct().ToList(); } } if (model == null) { model = new Sys_UserMapping(); } return(PartialView(model)); }
public void OnGet() { Sys_Roles = _sysRoleService.GetRoles(); }
public IActionResult RoleIndex() { return(View(_sysRoleService.GetRoles())); }