public ActionResult Edit(Maintenance maintenance) { if (ModelState.IsValid) { db.Entry(maintenance).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(maintenance); }
public ActionResult Create(Maintenance maintenance) { if (ModelState.IsValid) { db.Maintenances.Add(maintenance); db.SaveChanges(); return RedirectToAction("Index"); } return View(maintenance); }