private void btnConsultar_Click(object sender, EventArgs e) { try { Catalogo.frmMntDocumentoDato ofrmMntDocumentoDato = new Catalogo.frmMntDocumentoDato(); ofrmMntDocumentoDato.Operacion = "C"; ofrmMntDocumentoDato.Codigo = dgvDocumento.CurrentRow.Cells["IdDocumento"].Value.ToString(); ofrmMntDocumentoDato.ShowDialog(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnNuevo_Click(object sender, EventArgs e) { try { Catalogo.frmMntDocumentoDato ofrmMntDocumentoDato = new Catalogo.frmMntDocumentoDato(); ofrmMntDocumentoDato.Operacion = "N"; ofrmMntDocumentoDato.ShowDialog(); btnBuscar.PerformClick(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }