Beispiel #1
0
 public void AgregarLineasCarroCompras(CarroCompras carroCompras)
 {
     foreach (var lineaCarro in carroCompras.Detalle)
     {
         var lineaOrden = new LineaOrden(lineaCarro.Producto, lineaCarro.Cantidad);
         this.Lineas.Add(lineaOrden);
     }
 }
Beispiel #2
0
 public void AgregarLineasCarroCompras(CarroCompras carroCompras)
 {
     foreach (var lineaCarro in carroCompras.Detalle)
     {
         var lineaOrden = new LineaOrden(lineaCarro.Producto, lineaCarro.Cantidad);
         this.Lineas.Add(lineaOrden);
     }
 }
        public void ReservarInventario(LineaOrden linea)
        {
            var inventarioDAO = new AlmacenDAO();
            var producto = linea.Producto;
            var inventario = inventarioDAO.CantidadInventario(producto.Id);
            if (inventario < linea.Cantidad)
                throw new InventarioInsuficienteException();

            inventarioDAO.DisminuirInventario(producto.Id, linea.Cantidad);
        }