Example #1
0
        public ActionResult ChooseRolePartial(string username)
        {
            var helper = new UserRolesHelper();
            //ApplicationDbContext UserDb = new ApplicationDbContext();
            var ListOfRoles = db.Roles.OrderBy(r => r.Name).ToList().Select(rr => rr.Name.ToString()).ToList();

            var userRoles = helper.ListUserRoles(username);
            var roles     = ListOfRoles.Select(x => new SelectListItem
            {
                Value    = x,
                Text     = x,
                Selected = userRoles.Contains(x)
            }).ToArray();

            var model = new ChooseRoleModel {
                Roles = roles, Username = username
            };

            return(PartialView("Partials/ChooseRolePartial", model));
        }
Example #2
0
        public ActionResult ChooseRolePartial(ChooseRoleModel model)
        {
            var testReturnValue = model;

            return(View("Index"));
        }