private void btnAgregar_Click(object sender, EventArgs e) { EdicionRol frm = new EdicionRol(); frm.ShowDialog(); CargarDatos(); }
private void btnEditar_Click(object sender, EventArgs e) { EdicionRol frm = new EdicionRol(); frm.txtIDRol.Text = dtgRegistros.CurrentRow.Cells["IDRol"].Value.ToString(); frm.txtRol.Text = dtgRegistros.CurrentRow.Cells["Rol"].Value.ToString(); frm.ShowDialog(); CargarDatos(); }
private void btnEditar_Click(object sender, EventArgs e) { if (MessageBox.Show("Desea editar el registro seleccionado?", "Pregunta", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { EdicionRol frm = new EdicionRol(); frm.txtIDRol.Text = dtgRegistros.CurrentRow.Cells["IDRol"].Value.ToString(); frm.txtRol.Text = dtgRegistros.CurrentRow.Cells["Rol"].Value.ToString(); frm.ShowDialog(); CargarDatos(); } }
private void btnEditar_Click(object sender, EventArgs e) { try { if (CLS.MyMessageBox.ShowMessage("Desea editar el registro seleccionado?", "Pregunta", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { EdicionRol frm = new EdicionRol(); frm.txbIDRol.Text = dtgRegistros.CurrentRow.Cells[0].Value.ToString(); frm.txbRol.Text = dtgRegistros.CurrentRow.Cells[1].Value.ToString(); frm.ShowDialog(); CargarDatos(); } } catch { CLS.MyMessageBox.ShowMessage("Ocurrió un Error a la hora de EDITAR", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }