private void btnEditar_Click(object sender, EventArgs e) { try { if (dgvGestion.RowCount > 0) { if (!dgvGestion.CurrentRow.Cells["IdEstado_tt"].Value.ToString().Equals("00154")) { MessageBox.Show("Solo se pueden gestionar los compromisos vigentes.", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } Formula.GestionComercial.frmGestionDato ofrmGestionDato = new Formula.GestionComercial.frmGestionDato(); ofrmGestionDato.Operacion = "M"; ofrmGestionDato.IdGestionAtendida = dgvGestion.CurrentRow.Cells["IdGestion"].Value.ToString(); ofrmGestionDato.IdEntidad = dgvGestion.CurrentRow.Cells["IdEntidad"].Value.ToString(); ofrmGestionDato.Entidad = dgvGestion.CurrentRow.Cells["Entidad"].Value.ToString(); ofrmGestionDato.FlgSocio = int.Parse(dgvGestion.CurrentRow.Cells["FlgSocio"].Value.ToString()); ofrmGestionDato.ShowDialog(); btnBuscar.PerformClick(); } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnNuevo_Click(object sender, EventArgs e) { try { Formula.GestionComercial.frmGestionDato ofrmGestionDato = new Formula.GestionComercial.frmGestionDato(); ofrmGestionDato.Operacion = "N"; ofrmGestionDato.ShowDialog(); btnBuscar.PerformClick(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }