private void btnProductos_Click(object sender, EventArgs e) { ConsultarProductos ConPro = new ConsultarProductos(); ConPro.ShowDialog(); //double comparacion; //string extraer if (ConPro.DialogResult == DialogResult.OK) { double extraer = Convert.ToDouble(ConPro.dataGridView1.Rows[ConPro.dataGridView1.CurrentRow.Index].Cells[3].Value.ToString()); if (extraer == 0) { MessageBox.Show("No hay productos existentes"); } else { txtCodigoPro.Text = ConPro.dataGridView1.Rows[ConPro.dataGridView1.CurrentRow.Index].Cells[0].Value.ToString(); txtDescripcion.Text = ConPro.dataGridView1.Rows[ConPro.dataGridView1.CurrentRow.Index].Cells[1].Value.ToString(); txtPrecio.Text = ConPro.dataGridView1.Rows[ConPro.dataGridView1.CurrentRow.Index].Cells[2].Value.ToString(); txtCantidad.Focus(); } } }
private void btnProductos_Click(object sender, EventArgs e) { ConsultarProductos conPro = new ConsultarProductos(); conPro.ShowDialog(); if (conPro.DialogResult == DialogResult.OK) { txtCodigoPro.Text = conPro.dataGridView1.Rows[conPro.dataGridView1.CurrentRow.Index].Cells[0].Value.ToString(); txtDescripcion.Text = conPro.dataGridView1.Rows[conPro.dataGridView1.CurrentRow.Index].Cells[1].Value.ToString(); txtPrecio.Text = conPro.dataGridView1.Rows[conPro.dataGridView1.CurrentRow.Index].Cells[2].Value.ToString(); txtCantidad.Focus(); } }
private void button1_Click(object sender, EventArgs e) { ConsultarProductos ConCli = new ConsultarProductos(); ConCli.ShowDialog(); if (ConCli.DialogResult == DialogResult.OK) { txtIdPro.Text = ConCli.dataGridView1.Rows[ConCli.dataGridView1.CurrentRow.Index].Cells[0].Value.ToString(); txtNomPro.Text = ConCli.dataGridView1.Rows[ConCli.dataGridView1.CurrentRow.Index].Cells[1].Value.ToString(); txtPrePro.Text = ConCli.dataGridView1.Rows[ConCli.dataGridView1.CurrentRow.Index].Cells[2].Value.ToString(); } }