public IActionResult EliminarProveedor(int proveedorId)
 {
     if (proveedorId != 0)
     {
         if (_context.Proveedores.Find(proveedorId) != null)
         {
             _context.Proveedores.Remove(_context.Proveedores.Find(proveedorId));
             _context.SaveChanges();
         }
     }
     RegistraBitacora("Proveedores", "Borrado");
     return(View("Proveedores", _context.Proveedores.ToList()));
 }
示例#2
0
 public IActionResult BorrarBrand(int marcaId)
 {
     if (marcaId != 0)
     {
         if (_context.Brands.Find(marcaId) != null)
         {
             _context.Brands.Remove(_context.Brands.Find(marcaId));
             _context.SaveChanges();
         }
     }
     RegistraBitacora("Brands", "Borrado");
     return(View("Brands", _context.Brands.ToList()));
 }
 public IActionResult BorrarInformatico(int informId)
 {
     ViewBag.Context = _context;
     if (informId != 0)
     {
         if (_context.Informaticos.Find(informId) != null)
         {
             _context.Informaticos.Remove(_context.Informaticos.Find(informId));
             _context.SaveChanges();
         }
     }
     RegistraBitacora("Informaticos", "Borrado");
     return(View("Informaticos", _context.Informaticos.ToList()));
 }
        public IActionResult Eliminar(int inventarioId)
        {
            ViewBag.Context = _context;
            if (inventarioId != 0)
            {
                if (_context.Inventario.Find(inventarioId) != null)
                {
                    _context.Inventario.Remove(_context.Inventario.Find(inventarioId));
                    _context.SaveChanges();
                }
            }
            List <Inventario> inventario = _context.Inventario.FromSqlRaw(sql).ToList();

            RegistraBitacora("Inventario", "Borrado");
            return(View("Inventario", inventario));
        }
示例#5
0
 public IActionResult NuevaLending(Lending lending)
 {
     lending.DtLend  = DateTime.Now;
     ViewBag.Context = _context;
     _context.Lendings.Add(lending);
     _context.SaveChanges();
     RegistraBitacora("Lendings", "Inserción");
     return(View("ListaDeLendings", _context.Lendings.ToList()));
 }