public ActionResult DeleteUserConfirmed(int id)
        {
            UserProfileViewModel user = new UserProfileViewModel(UserProfileDAL.SelectUserById(id));

            InfoCardDAL.UpdateInfoCardDescription(
                    WebSecurity.CurrentUserId,
                    "Deleted user: \"" + user.UserName + "\""
                    );

            UserProfileDAL.RemoveUserFromBugs(id);

            InfoCardDAL.RemoveUserInfoCard(id);

            Roles.RemoveUserFromRoles(user.UserName, Roles.GetRolesForUser(user.UserName));

            ((SimpleMembershipProvider)Membership.Provider).DeleteAccount(user.UserName);

            ((SimpleMembershipProvider)Membership.Provider).DeleteUser(user.UserName, true);

            return RedirectToAction("Index");
        }
 public EditUserProfileViewModel(UserProfileViewModel profile)
 {
     this.UserId = profile.UserId;
     this.UserName = profile.UserName;
     this.FirstName = profile.FirstName;
     this.LastName = profile.LastName;
     this.Email = profile.Email;
     this.PhoneNumber = profile.PhoneNumber;
 }
 public ActionResult DeleteUser(int id)
 {
     UserProfileViewModel user = new UserProfileViewModel(UserProfileDAL.SelectUserById(id));
     return View(user);
 }