コード例 #1
0
        public ActionResult allRoles(int?pageIndex)
        {
            RolesRepositery rolRep   = new RolesRepositery();
            var             listRole = rolRep.allRoles();

            if (listRole.Count() == 0)
            {
                ViewData["erreurMessage"] = "Aucun role existant!";
                ViewData["create"]        = "false";
                return(View("ErrorEmptyList"));
            }
            var countElementPage            = 10;
            PaginatedList <AspNetRoles> lst = new PaginatedList <AspNetRoles>(listRole, pageIndex, countElementPage);

            return(View("AllRoles", lst));
        }
コード例 #2
0
        public ActionResult RolesUsers()
        {
            RolesRepositery    rolRep = new RolesRepositery();
            EmployesRepositery empRp  = new EmployesRepositery();
            var listRole = rolRep.allRoles();

            if (listRole.Count() == 0)
            {
                ViewData["erreur"] = "Roles";
                return(View("ErrorEmptyElement"));
            }
            foreach (var rl in listRole)
            {
                rl.AspNetUsersList = empRp.getAllUsers().ToList();
            }
            return(View("AddUserRole", listRole.ToList()));
        }