Пример #1
0
 public ActionResult Create()
 {
     ApplicantVisaInfo applicantvisainfo = new ApplicantVisaInfo();
     ViewBag.PossibleApplicants = applicantRepository.All;
     ViewBag.PossibleVisaTypes = visaRepository.All;
     ViewBag.PossibleIssuanceCountries = countryRepository.All;
     ViewBag.PossibleStates = stateRepository.All;
     ViewBag.PossibleVisaStatus = visastatusRepository.All;
     return View(applicantvisainfo);
 }
Пример #2
0
 public ActionResult Create(ApplicantVisaInfo applicantvisainfo)
 {
     if (ModelState.IsValid) {
         applicantvisainfoRepository.InsertOrUpdate(applicantvisainfo);
         applicantvisainfoRepository.Save();
         return RedirectToAction("Index");
     } else {
         ViewBag.PossibleApplicants = applicantRepository.All;
         ViewBag.PossibleVisaTypes = visaRepository.All;
         ViewBag.PossibleIssuanceCountries = countryRepository.All;
         ViewBag.PossibleStates = stateRepository.All;
         ViewBag.PossibleVisaStatus = visastatusRepository.All;
         return View(applicantvisainfo);
     }
 }
Пример #3
0
 public void InsertOrUpdate(ApplicantVisaInfo applicantvisainfo)
 {
     if (applicantvisainfo.AplicantVisaInfoID == default(int)) {
         // New entity
         context.ApplicantVisaInfo.Add(applicantvisainfo);
     } else {
         // Existing entity
         context.Entry(applicantvisainfo).State = EntityState.Modified;
     }
 }
Пример #4
0
 public ViewResult Search(ApplicantVisaInfo searchApplicantVisaInfo)
 {
     if(searchApplicantVisaInfo!=null)
     {
                     }
                 return View("Index",applicantvisainfoRepository.AllIncluding(applicantvisainfo => applicantvisainfo.Applicant, applicantvisainfo => applicantvisainfo.VisaType, applicantvisainfo => applicantvisainfo.IssuanceCountry, applicantvisainfo => applicantvisainfo.State, applicantvisainfo => applicantvisainfo.VisaStatus));
 }