public ActionResult Create(MaritalStatus maritalstatus) { if (ModelState.IsValid) { maritalstatusRepository.InsertOrUpdate(maritalstatus); maritalstatusRepository.Save(); return RedirectToAction("Index"); } else { return View(); } }
public void InsertOrUpdate(MaritalStatus maritalstatus) { if (maritalstatus.MaritalStatusID == default(int)) { // New entity context.MaritalStatus.Add(maritalstatus); } else { // Existing entity context.Entry(maritalstatus).State = EntityState.Modified; } }
public ViewResult Search(MaritalStatus searchMaritalStatus) { if(searchMaritalStatus!=null) { } return View("Index",maritalstatusRepository.All); }