public ActionResult Edit(Samochody samochody) { if (ModelState.IsValid) { SamochodyPDEntities db = new SamochodyPDEntities(); db.Entry(samochody).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("SamochodyLista")); } return(View(samochody)); }
public ActionResult AwariaMechaniczna(AwariaMechaniczna model, int id) { if (ModelState.IsValid) { SamochodyPDEntities db = new SamochodyPDEntities(); db.Entry(model).State = EntityState.Added; model.id_samochod = id; db.SaveChanges(); return(RedirectToAction("AwariaMechaniczna", id)); } return(RedirectToAction("AwariaMechaniczna", id)); }