private void button_nuevo_Click(object sender, EventArgs e) { AddEditRole nuevo_rol = new AddEditRole(); DialogResult res = nuevo_rol.ShowDialog(); if (res == DialogResult.Cancel) { refresh_grid(); } }
private void button_modif_Click(object sender, EventArgs e) { if (dataGrid_rol.SelectedRows.Count == 1) { AddEditRole edit_rol = new AddEditRole(); var row = dataGrid_rol.CurrentRow; var rol = row.DataBoundItem as Rol; edit_rol.PreSet(rol); DialogResult res = edit_rol.ShowDialog(); if (res == DialogResult.Cancel) { refresh_grid(); } } else { MessageBox.Show("Debe seleccionar una fila"); } }