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