public ActionResult ManageUser(UserProfileViewModel model) { if (ModelState.IsValid) { UserProfile userProfile = UserProfile.GetProfile(User.Identity.Name); if (userProfile != null) { userProfile.FirstName = model.FirstName; userProfile.LastName = model.LastName; userProfile.PhoneNumber = model.PhoneNumer; userProfile.Email = model.Email; userProfile.Save(); return RedirectToAction("Index", "Home"); } } return View(model); }
public ActionResult ManageUser() { UserProfileViewModel model = new UserProfileViewModel(); UserProfile userProfile = UserProfile.GetProfile(User.Identity.Name); if (userProfile != null) { model.CompanyId = userProfile.CompanyId; model.Email = userProfile.Email; model.FirstName = userProfile.FirstName; model.LastName = userProfile.LastName; model.PhoneNumer = userProfile.PhoneNumber; } return View(model); }