private void btnBuscar_Click(object sender, EventArgs e)
        {
            Producto producto = inventario.buscarProducto(Convert.ToInt32(txtCodigo.Text));

            if (producto != null)
            {
                txtInformacion.Text = producto.ToString();
            }
            else
            {
                txtInformacion.Text = "El producto no existe";
            }
        }
Esempio n. 2
0
        public string reporte()
        {
            string texto = "";

            if (numeroProductos != 0)
            {
                Producto actual = inicio;
                while (actual != null)
                {
                    texto += actual.ToString() + Environment.NewLine;
                    actual = actual.productoSiguiente;
                }
            }
            else
            {
                texto = "No hay productos.";
            }
            return(texto);
        }