private void btnBuscarCliente_Click(object sender, EventArgs e) { var frm = new FormOperacionesFacturacionEmergente(); frm.ShowDialog(); if (frm.DialogResult == DialogResult.OK) { int i = frm.dgDatos.CurrentRow.Index; txtClienteID.Text = frm.dgDatos.Rows[i].Cells["ID"].Value.ToString(); string nombre = frm.dgDatos.Rows[i].Cells["Primer Nombre"].Value.ToString(); string apellido = frm.dgDatos.Rows[i].Cells["Primer Apellido"].Value.ToString(); txtClienteNombre.Text = $"{nombre} {apellido}"; } }
private void btnBuscarProducto_Click(object sender, EventArgs e) { var frm = new FormOperacionesFacturacionEmergente(false); frm.ShowDialog(); if (frm.DialogResult == DialogResult.OK) { int i = frm.dgDatos.CurrentRow.Index; txtProductoID.Text = frm.dgDatos.Rows[i].Cells["ID"].Value.ToString(); txtProductoNombre.Text = frm.dgDatos.Rows[i].Cells["Nombre"].Value.ToString(); txtProductoPrecio.Text = frm.dgDatos.Rows[i].Cells["Precio"].Value.ToString(); txtProductoCantidad.Clear(); txtProductoCantidad.Focus(); } }