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