public ActionResult PersonIndex(PersonProfileViewModel profileDetails) { //code for saving data Person person = new Person(); person.Id = profileDetails.Id; person.FirstName = profileDetails.FirstName; person.LastName = profileDetails.LastName; person.DOB = profileDetails.DOB; person.PhoneNumber = profileDetails.PhoneNumber; person.Email = profileDetails.Email; person.StreetAddress = profileDetails.StreetAddress; person.City = profileDetails.City; person.State = profileDetails.State; person.Zipcode = profileDetails.Zipcode; person.IsPollutionATrigger = profileDetails.IsPollutionATrigger; person.ArePollensATrigger = profileDetails.ArePollensATrigger; person.AreDustMitesATrigger = profileDetails.AreDustMitesATrigger; person.IsTobaccoSmokeATrigger = profileDetails.IsTobaccoSmokeATrigger; person.IsMoldATrigger = profileDetails.IsMoldATrigger; person.AreBurningWoodOrGrassATrigger = profileDetails.AreBurningWoodOrGrassATrigger; person.DoctorId = Convert.ToInt32(profileDetails.SelectedDoctor); context.People.Add(person); context.SaveChanges(); return(RedirectToAction("DetailsView", new { id = profileDetails.Id })); }
/// <summary> /// Created view for person profile-redirected from registration of person/patient /// </summary> /// <returns></returns> public ActionResult PersonIndex() { PersonProfileViewModel personProfile = new PersonProfileViewModel(); var userId = User.Identity.GetUserId(); var person = context.People.Where(p => p.ApplicationId == userId).FirstOrDefault(); personProfile.Id = person.Id; personProfile.FirstName = person.FirstName; personProfile.LastName = person.LastName; personProfile.DOB = person.DOB; personProfile.PhoneNumber = person.PhoneNumber; personProfile.Email = person.Email; personProfile.StreetAddress = person.StreetAddress; personProfile.City = person.City; personProfile.State = person.State; personProfile.Zipcode = person.Zipcode; personProfile.IsPollutionATrigger = person.IsPollutionATrigger; personProfile.ArePollensATrigger = person.ArePollensATrigger; personProfile.AreDustMitesATrigger = person.AreDustMitesATrigger; personProfile.IsTobaccoSmokeATrigger = person.IsTobaccoSmokeATrigger; personProfile.IsMoldATrigger = person.IsMoldATrigger; personProfile.AreBurningWoodOrGrassATrigger = person.AreBurningWoodOrGrassATrigger; personProfile.Doctors = FillDoctorDropdown(); return(View(personProfile)); }
public IActionResult CreatePerson(PersonProfileViewModel model) { if (!ModelState.IsValid) { ViewData["Message"] = "Your Profile has been created Successfully!"; return(View(model)); } return(RedirectToAction("Index", "Home")); }