示例#1
0
        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);
        }
示例#2
0
        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);
        }