public void agregarMaterial(int idMaterial, int cantidad) { Material material = negocio.buscarMaterial(idMaterial); int idLineaCompra = compra.crearLineaDeCompra(material, cantidad); NuevaCompraView view = (NuevaCompraView)vista; view.agregarMaterialACompra(idLineaCompra, material.IdMaterial, material.Descripcion, cantidad); }
public void agregarMaterialAUsar(int idMaterial, int cantidad) { Material material = negocio.buscarMaterial(idMaterial); int cantidadDisponible = (material.StockDisponible - material.StockMinimo); if (cantidad > cantidadDisponible) { throw new Exception("No hay cantidad suficiente (" + cantidadDisponible + ")"); } pedido.agregarMaterialAUsar(material, cantidad); }