private void btnEditar_Click(object sender, EventArgs e) { try { General.General.ValidarTipoCambio(); if (gvRenovacion.RowCount > 0) { string IdEstado_tt = gvRenovacion.CurrentRow.Cells["IdEstado_tt"].Value.ToString(); if (IdEstado_tt == "00113") //Anulado { MessageBox.Show("No se puede editar este registro.", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } frmRenovacionDato ofrmRenovacionDato = new frmRenovacionDato(); ofrmRenovacionDato.Operacion = "M"; ofrmRenovacionDato.Codigo = gvRenovacion.CurrentRow.Cells["IdRenovacion"].Value.ToString(); ofrmRenovacionDato.ShowDialog(); btnBuscar.PerformClick(); } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnNuevo_Click(object sender, EventArgs e) { try { General.General.ValidarTipoCambio(); frmRenovacionDato ofrmRenovacionDato = new frmRenovacionDato(); ofrmRenovacionDato.Operacion = "N"; ofrmRenovacionDato.ShowDialog(); btnBuscar.PerformClick(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }