Beispiel #1
0
        //列出所有權限和會員
        public ActionResult EditRoleMember()
        {
            RoleMemberViewModel viewModel = new RoleMemberViewModel()
            {
                Roles   = roleSrv.GetAll().ToList(),
                Members = memSrv.GetAll().ToList()
            };

            return(View(viewModel));
        }
Beispiel #2
0
        //列出某會員的權限
        public ActionResult RoleList(int id)
        {
            //id = MemberId
            RoleMemberViewModel viewModel = new RoleMemberViewModel()
            {
                Roles           = roleSrv.GetRestRole(id).ToList(),
                Members         = memSrv.GetAll().ToList(),
                RoleMembers     = roleSrv.GetRoleMember(id).ToList(),
                CurrentMemberId = id
            };

            return(View("EditRoleMember", viewModel));
        }
        public async Task <IActionResult> RoleMember(int id = -1, string roleName = "")
        {
            if (id <= -1)
            {
                Utility.WriteMessage("没有指定要管理的角色", "mClose");
                return(View());
            }
            ViewBag.RoleName = roleName;
            RoleMemberViewModel roleMemberViewModel = new RoleMemberViewModel();

            roleMemberViewModel.MemberByRole = await _RolesService.GetMemberListByRoleID(id);

            roleMemberViewModel.MemberByNotRole = await _RolesService.GetMemberListNotInRole(id);

            return(View(roleMemberViewModel));
        }