private void dgv_DoubleClick(object sender, EventArgs e) { tblCliente cliente = new tblCliente(); DataGridViewSelectedRowCollection rows = ((DataGridView)sender).SelectedRows; foreach (DataGridViewRow dato in rows) { cliente = new blCliente().gmtdConsultarDetalle(dato.Cells[0].Value.ToString()); } if (cliente.strContacto != null) { this.txtCodigo.Enabled = false; this.txtCodigo.Text = cliente.strCodigoCli; this.txtEmpresa.Text = cliente.strEmpresa; this.txtContacto.Text = cliente.strContacto; this.txtDireccion.Text = cliente.strDireccion; this.txtTelefono.Text = cliente.strTelefono; this.txtCelular.Text = cliente.strCelular; this.txtMail.Text = cliente.strCorreo; this.cboTipo.SelectedText = cliente.strTipoDoc; this.cboTipoTercero.Text = cliente.strTipoCliente; this.dtpIngreso.Value = cliente.dtmFechaIng; } }
/// <summary> /// Carga la grid con datos si tiene permisos necesarios. /// </summary> private void pmtdCargarGrid() { if (propiedades.bitConsultar == true) { blCliente blCli = new blCliente(); this.dgvClientes.DataSource = blCli.gmtdConsultarTodos(); } }
private void btnModificar_Click(object sender, EventArgs e) { string strRespuesta = new blCliente().gmtdEditar(crearObj()); this.pmtdMensaje(strRespuesta, "Clientes"); this.pmtdCargarGrid(); if (strRespuesta.Substring(0, 1) != "-") { this.pmtdLimpiarText(); this.pmtdHabilitarText(true); } }