public ActionResult Create() { ApplicantPassportInfo applicantpassportinfo = new ApplicantPassportInfo(); ViewBag.PossibleApplicants = applicantRepository.All; ViewBag.PossibleNationalityCountries = countryRepository.All; ViewBag.PossibleIssuanceCountries = countryRepository.All; ViewBag.PossibleStates = stateRepository.All; ViewBag.PossibleVerifiedByUsers = userRepository.All; return View(applicantpassportinfo); }
public ActionResult Create(ApplicantPassportInfo applicantpassportinfo) { if (ModelState.IsValid) { applicantpassportinfoRepository.InsertOrUpdate(applicantpassportinfo); applicantpassportinfoRepository.Save(); return RedirectToAction("Index"); } else { ViewBag.PossibleApplicants = applicantRepository.All; ViewBag.PossibleNationalityCountries = countryRepository.All; ViewBag.PossibleIssuanceCountries = countryRepository.All; ViewBag.PossibleStates = stateRepository.All; ViewBag.PossibleVerifiedByUsers = userRepository.All; return View(applicantpassportinfo); } }
public ViewResult Search(ApplicantPassportInfo searchApplicantPassportInfo) { if(searchApplicantPassportInfo!=null) { } return View("Index",applicantpassportinfoRepository.AllIncluding(applicantpassportinfo => applicantpassportinfo.Applicant, applicantpassportinfo => applicantpassportinfo.NationalityCountry, applicantpassportinfo => applicantpassportinfo.IssuanceCountry, applicantpassportinfo => applicantpassportinfo.State, applicantpassportinfo => applicantpassportinfo.VerifiedByUser)); }
public void InsertOrUpdate(ApplicantPassportInfo applicantpassportinfo) { if (applicantpassportinfo.ApplicantPassportInfoID == default(int)) { // New entity context.ApplicantPassportInfo.Add(applicantpassportinfo); } else { // Existing entity context.Entry(applicantpassportinfo).State = EntityState.Modified; } }