//Cargar codigo de un nuevo medicamento private void pictureBox1_Click(object sender, EventArgs e) { claseMedicamento cm = new claseMedicamento(); OpenFileDialog OD = new OpenFileDialog(); OD.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop); if (OD.ShowDialog() == DialogResult.OK) { pictureBox1.Load(OD.FileName); } BarcodeDecoder Scanner = new BarcodeDecoder(); Result result = Scanner.Decode(new Bitmap(pictureBox1.Image)); lblScannerNumero.Text = result.Text; cm = cnx.buscarmedicamento(lblScannerNumero.Text); txtNombre.Text = cm.Nombre; txtPrecio.Text = Convert.ToString(cm.Precio); txtStockMin.Text = Convert.ToString(cm.Stockminimo); txtStockActual.Text = Convert.ToString(cm.Stockactual); cnx.añadirMedicamento(cm); }