public ActionResult Create() { ApplicantDocument applicantdocument = new ApplicantDocument(); ViewBag.PossibleApplicants = applicantRepository.All; ViewBag.PossibleApplicantDocumentCategories = applicantdocumentcategoryRepository.All; return View(applicantdocument); }
public ActionResult Create(ApplicantDocument applicantdocument) { if (ModelState.IsValid) { applicantdocumentRepository.InsertOrUpdate(applicantdocument); applicantdocumentRepository.Save(); return RedirectToAction("Index"); } else { ViewBag.PossibleApplicants = applicantRepository.All; ViewBag.PossibleApplicantDocumentCategories = applicantdocumentcategoryRepository.All; return View(applicantdocument); } }
public ViewResult Search(ApplicantDocument searchApplicantDocument) { if(searchApplicantDocument!=null) { } return View("Index",applicantdocumentRepository.AllIncluding(applicantdocument => applicantdocument.Applicant, applicantdocument => applicantdocument.ApplicantDocumentCategory)); }
public void InsertOrUpdate(ApplicantDocument applicantdocument) { if (applicantdocument.ApplicantDocumentID == default(int)) { // New entity context.ApplicantDocument.Add(applicantdocument); } else { // Existing entity context.Entry(applicantdocument).State = EntityState.Modified; } }