Exemplo n.º 1
0
        public ActionResult UpdateAccess(Guid?roleId = null)
        {
            var role = _roleRepository.GetById(roleId ?? Guid.Empty);

            if (role == null)
            {
                return(null);
            }

            AccessMenuVM vm = new AccessMenuVM();

            vm.Role = RoleVM.GetDTO(role);

            var criteria = new MenuRoleMapCriteria {
                RoleId = role.Id
            };
            var specification = new MenuRoleMapSpecification(criteria);
            var menuMapList   = _menuRoleMapRepository.Find(specification).OrderBy(x => x.Menu.Order).ToList();

            vm.Menus = menuMapList.Select(x => MenuRoleMapVM.GetDTO(x)).ToList();

            return(PartialView("_AccessMenuView", vm));
        }
Exemplo n.º 2
0
        // GET: Tech
        public ActionResult Role()
        {
            var roles = _roleRepository.Get().OrderBy(x => x.RoleName).ToList();

            return(View(roles.Select(x => RoleVM.GetDTO(x))));
        }
Exemplo n.º 3
0
        public ActionResult ManageMenu()
        {
            ManageMenuVM vm = new ManageMenuVM();

            vm.Roles = _roleRepository.Get().OrderBy(x => x.RoleName).ToList().Select(x => RoleVM.GetDTO(x)).ToList();
            return(View(vm));
        }