public ActionResult Edit(string id) { id = UsernameUrl.Decode(id).ToLowerInvariant(); if (User.Identity.Name.ToLowerInvariant() != id && !User.IsInRole(Definitions.Roles.Administrator)) { return(RedirectToAction("Unauthorized", "Home")); } if (!String.IsNullOrEmpty(id)) { var user = MembershipService.GetUser(id); if (user != null) { var roles = Roles.GetRolesForUser(id); var model = new UserEditModel { Username = id, Name = user.Name, Surname = user.Surname, Email = user.Email, Roles = roles, }; PopulateRoles(); return(View(model)); } } return(View()); }
public ActionResult Detail(string id) { if (!String.IsNullOrEmpty(id)) { return(View(ConvertTeamModel(TeamRepository.GetTeam(UsernameUrl.Decode(id))))); } return(View()); }
public ActionResult Edit(string id) { if (!String.IsNullOrEmpty(id)) { var model = ConvertTeamModel(TeamRepository.GetTeam(UsernameUrl.Decode(id))); PopulateViewData(); return(View(model)); } return(View()); }
public ActionResult Delete(string id) { if (!String.IsNullOrEmpty(id)) { return(View(new TeamDetailModel { Name = UsernameUrl.Decode(id) })); } return(RedirectToAction("Index")); }
public ActionResult Delete(string id) { if (!String.IsNullOrEmpty(id)) { id = UsernameUrl.Decode(id).ToLowerInvariant(); return(View(new UserDetailModel { Username = id })); } return(RedirectToAction("Index")); }
public ActionResult Detail(string id) { if (!String.IsNullOrEmpty(id)) { id = UsernameUrl.Decode(id); var user = MembershipService.GetUser(id); if (user != null) { var model = new UserDetailModel { Username = user.Username, Name = user.Name, Surname = user.Surname, Email = user.Email, Roles = user.Roles, }; return(View(model)); } } return(View()); }