コード例 #1
0
 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);
 }
コード例 #2
0
 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);
     }
 }
コード例 #3
0
 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));
 }
コード例 #4
0
 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;
     }
 }