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