public async Task <ActionResult> DeleteConfirmed(int id) { inventario inventario = await db.inventarios.FindAsync(id); db.inventarios.Remove(inventario); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public async Task <ActionResult> Edit([Bind(Include = "ID,Cantidad,Tipo,Nombre,Costo")] inventario inventario) { if (ModelState.IsValid) { db.Entry(inventario).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(inventario)); }
public async Task <ActionResult> Create([Bind(Include = "ID,Cantidad,Tipo,Nombre,Costo")] inventario inventario) { if (ModelState.IsValid) { db.inventarios.Add(inventario); await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(inventario)); }
// GET: inventarios/Delete/5 public async Task <ActionResult> Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } inventario inventario = await db.inventarios.FindAsync(id); if (inventario == null) { return(HttpNotFound()); } return(View(inventario)); }