private void u_CargaBancos() { var xcodcliente = txtcodigo.Text; try { var BL = new cliente_bancoBL(); var BE = new tb_cliente_banco(); BE.ctacte = xcodcliente; TablaBancos = BL.GetAll(VariablesPublicas.EmpresaID.ToString(), BE).Tables[0]; gridBancos.AutoGenerateColumns = false; gridBancos.DataSource = TablaBancos; txtCodigob.Text = string.Empty; txtRucb.Text = string.Empty; txtCtactenameb.Text = string.Empty; if ((u_n_opsel == 0)) { if (!(GridExaminar.CurrentRow == null)) { txtCodigob.Text = GridExaminar.Rows[GridExaminar.CurrentRow.Index].Cells["ctacte"].Value.ToString(); txtRucb.Text = GridExaminar.Rows[GridExaminar.CurrentRow.Index].Cells["nmruc"].Value.ToString(); txtCtactenameb.Text = GridExaminar.Rows[GridExaminar.CurrentRow.Index].Cells["ctactename"].Value.ToString(); } } else { txtCodigob.Text = txtcodigo.Text; txtRucb.Text = txtmnruc.Text; txtCtactenameb.Text = txtrazonsocial.Text; } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }