public ActionResult ChangePassengerDetails() { ChangePassengerDetailsViewModel model = new ChangePassengerDetailsViewModel(); User user = System.Web.HttpContext.Current.GetOwinContext() .GetUserManager <ApplicationUserManager>() .FindById(System.Web.HttpContext.Current.User.Identity.GetUserId()); model.Id = user.Id; model.UserName = user.UserName; model.Email = user.Email; model.Fullname = user.Fullname; model.PhoneNumber = user.PhoneNumber; return(View(model)); }
public ActionResult ChangePassengerDetails(ChangePassengerDetailsViewModel model) { if (ModelState.IsValid) { User user = UserManager.FindById(model.Id); user.UserName = model.UserName; user.Email = model.Email; user.Fullname = model.Fullname; user.PhoneNumber = model.PhoneNumber; UserManager.Update(user); return(RedirectToAction("Index")); } return(View(model)); }