Esempio n. 1
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            inventario inventario = await db.inventarios.FindAsync(id);

            db.inventarios.Remove(inventario);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
Esempio n. 2
0
        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));
        }
Esempio n. 3
0
        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));
        }
Esempio n. 4
0
        // 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));
        }