public ActionResult Create() { ApplicantDisability applicantdisability = new ApplicantDisability(); ViewBag.PossibleApplicants = applicantRepository.All; ViewBag.PossibleDisabilities = disabilityRepository.All; return View(applicantdisability); }
public ActionResult Create(ApplicantDisability applicantdisability) { if (ModelState.IsValid) { applicantdisabilityRepository.InsertOrUpdate(applicantdisability); applicantdisabilityRepository.Save(); return RedirectToAction("Index"); } else { ViewBag.PossibleApplicants = applicantRepository.All; ViewBag.PossibleDisabilities = disabilityRepository.All; return View(applicantdisability); } }
public ViewResult Search(ApplicantDisability searchApplicantDisability) { if(searchApplicantDisability!=null) { } return View("Index",applicantdisabilityRepository.AllIncluding(applicantdisability => applicantdisability.Applicant, applicantdisability => applicantdisability.Disability)); }
public void InsertOrUpdate(ApplicantDisability applicantdisability) { if (applicantdisability.ApplicantDisabilityID == default(int)) { // New entity context.ApplicantDisability.Add(applicantdisability); } else { // Existing entity context.Entry(applicantdisability).State = EntityState.Modified; } }