Example #1
0
        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();
        }
Example #2
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public async Task <IViewComponentResult> InvokeAsync()
        {
            var roles = _sysRoleService.GetRoles();

            await Task.FromResult(0);

            return(View(roles));
        }
Example #3
0
 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();
 }
Example #4
0
        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));
        }
Example #5
0
        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));
        }
Example #6
0
 public void OnGet()
 {
     Sys_Roles = _sysRoleService.GetRoles();
 }
Example #7
0
 public IActionResult RoleIndex()
 {
     return(View(_sysRoleService.GetRoles()));
 }