public ActionResult EditProfile(EditProfileViewModel inModel) { if (!ModelState.IsValid) { return View(inModel); } var user = UserManager.FindById(User.Identity.GetUserId()); if (user != null) { user.BirthDate = inModel.BirthDate; user.DisplayUsername = inModel.DisplayUsername; user.FirstName = inModel.FirstName; user.LastName = inModel.LastName; user.Job = inModel.Job; user.School = inModel.School; user.AboutMe = inModel.AboutMe; user.WhoIAmHereToMeet = inModel.WhoIAmHereToMeet; user.WhatIAmLookingForInARelationship = inModel.WhatIAmLookingForInARelationship; user.ReligionOrLackThereof = inModel.ReligionOrLackThereof; user.City = inModel.City; user.State = inModel.State; user.ProfileImageLocation = inModel.ProfileImageLocation; user.MatchLowestAge = inModel.MatchLowestAge; user.MatchHighestAge = inModel.MatchHighestAge; user.ZipCode = inModel.ZipCode; user.HomeTimeZone = inModel.HomeTimeZone; user.NumberOfKids = inModel.NumberOfKids; user.HeightInInches = inModel.HeightInInches; user.Gender = inModel.Gender; user.GenderPreference = inModel.GenderPreference; user.MyZipCodeOnly = inModel.MyZipCodeOnly; user.DesireForKids = inModel.DesireForKids; user.WillingnessToDateParents = inModel.WillingnessToDateParents; user.Smoker = inModel.Smoker; user.Drinker = inModel.Drinker; user.Stoner = inModel.Stoner; user.Single = inModel.Single; user.Monogamous = inModel.Monogamous; } UserManager.Update(user); return View(inModel); }
// GET: TODO put link in here public ActionResult EditProfile() { var user = UserManager.FindById(User.Identity.GetUserId()); if (user != null) { var outModel = new EditProfileViewModel { BirthDate = user.BirthDate, DisplayUsername = user.DisplayUsername, FirstName = user.FirstName, LastName = user.LastName, Job = user.Job, School = user.School, AboutMe = user.AboutMe, WhoIAmHereToMeet = user.WhoIAmHereToMeet, WhatIAmLookingForInARelationship = user.WhatIAmLookingForInARelationship, ReligionOrLackThereof = user.ReligionOrLackThereof, City = user.City, State = user.State, ProfileImageLocation = user.ProfileImageLocation, MatchLowestAge = user.MatchLowestAge, MatchHighestAge = user.MatchHighestAge, ZipCode = user.ZipCode, HomeTimeZone = user.HomeTimeZone, NumberOfKids = user.NumberOfKids, HeightInInches = user.HeightInInches, Gender = user.Gender, GenderPreference = user.GenderPreference, MyZipCodeOnly = user.MyZipCodeOnly, DesireForKids = user.DesireForKids, WillingnessToDateParents = user.WillingnessToDateParents, Smoker = user.Smoker, Drinker = user.Drinker, Stoner = user.Stoner, Single = user.Single, Monogamous = user.Monogamous, }; return View(outModel); } return View(); }