// // 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)); }
/// <summary> /// Gets user information from the data source based on the unique identifier for the membership user. /// Provides an option to update the last-activity date/time stamp for the user. /// </summary> /// <param name="providerUserKey"></param> /// <param name="userIsOnline"></param> /// <returns></returns> public override MembershipUser GetUser(object providerUserKey, bool userIsOnline) { string strId = providerUserKey.ToString(); int id = Int32.Parse(strId); return(_membershipProviderApplicationService.GetUserById(id, userIsOnline, ProviderName)); }