private void btnModificar_Click(object sender, EventArgs e) { try { DataGridViewRow dr = dgvRoles.CurrentRow; DataGridViewCell cellNombre = dr.Cells["Nombre"]; DataGridViewCell cellIdRol = dr.Cells["IdRol"]; int id = Convert.ToInt32(cellIdRol.Value); String n = Convert.ToString(cellNombre.Value); View.ABM_Rol.RolAM rolMod = new RolAM(this); rolMod.Text = "Modificacion de Rol"; rolMod.asignarRolAModificar(id, n); rolMod.Visible = true; this.Visible = false; } catch (Exception ex) { View.Error.ErrorForm vtnError = new View.Error.ErrorForm(ex.Message); vtnError.Visible = true; } }
private void btnNuevo_Click(object sender, EventArgs e) { try { View.ABM_Rol.RolAM vtnAlta = new RolAM(this); vtnAlta.Text = "Alta de Rol"; vtnAlta.Visible = true; this.Visible = false; } catch (Exception ex) { View.Error.ErrorForm vtnError = new View.Error.ErrorForm(ex.Message); vtnError.Visible = true; } }