public ActionResult DeleteConfirmed(int id) { tbl1 tbl1 = db.tbl1.Find(id); db.tbl1.Remove(tbl1); db.SaveChanges(); return(RedirectToAction("Index")); }
// // GET: /teste/Delete/5 public ActionResult Delete(int id = 0) { tbl1 tbl1 = db.tbl1.Find(id); if (tbl1 == null) { return(HttpNotFound()); } return(View(tbl1)); }
public ActionResult Edit(tbl1 tbl1) { if (ModelState.IsValid) { db.Entry(tbl1).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tbl1)); }
public ActionResult Create(tbl1 tbl1) { if (ModelState.IsValid) { db.tbl1.Add(tbl1); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tbl1)); }