Exemplo n.º 1
0
        //
        // GET: /User/Edit/5

        public ActionResult EditUser(int id)
        {
            var membershipUser = _membershipProviderApplicationService.GetUserById(id, false, "ShopgunMembershipProvider") as ShopgunMembershipUser;
            var user           = membershipUser != null?membershipUser.ToUser() : new User();

            var mentors = _mentorApplicationService.GetAllMentors();

            ViewData["Mentor"] = new SelectList(mentors, "Id", "MentorName");
            var usersRoles = _roleProviderApplicationService.GetRolesForUser(user.UserName);

            ViewData["UsersRoles"] = usersRoles;
            var roles = _roleProviderApplicationService.GetAllRoles();

            ViewData["Role"] = roles;
            return(View(user));
        }
Exemplo n.º 2
0
 public override string[] GetRolesForUser(string username)
 {
     return(_roleProviderApplicationService.GetRolesForUser(username));
 }