public ActionResult DeleteConfirmed(int id) { MarkaAvtomobil markaAvtomobil = db.MarkaAvtomobils.Find(id); db.MarkaAvtomobils.Remove(markaAvtomobil); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Name,SNorm,WNorm,Toplivo,KmMoto,EzdkaPricep,NormaEzdka")] MarkaAvtomobil markaAvtomobil) { if (ModelState.IsValid) { db.Entry(markaAvtomobil).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(markaAvtomobil)); }
public ActionResult Create([Bind(Include = "Id,Name,SNorm,WNorm,Toplivo,KmMoto,EzdkaPricep,NormaEzdka")] MarkaAvtomobil markaAvtomobil) { if (ModelState.IsValid) { db.MarkaAvtomobils.Add(markaAvtomobil); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(markaAvtomobil)); }
// GET: MarkaAvtomobils/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } MarkaAvtomobil markaAvtomobil = db.MarkaAvtomobils.Find(id); if (markaAvtomobil == null) { return(HttpNotFound()); } return(View(markaAvtomobil)); }