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