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