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