public ActionResult DeleteConfirmed(int id) { Karnet karnet = db.Karnet.Find(id); db.Karnet.Remove(karnet); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Dni,Koszt")] Karnet karnet) { if (ModelState.IsValid) { db.Entry(karnet).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(karnet)); }
public ActionResult Create([Bind(Include = "Id,Dni,Koszt")] Karnet karnet) { if (ModelState.IsValid) { db.Karnet.Add(karnet); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(karnet)); }
// GET: Karnet/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Karnet karnet = db.Karnet.Find(id); if (karnet == null) { return(HttpNotFound()); } return(View(karnet)); }