Exemple #1
0
        private void DataGrid_Roles_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex == 3)
            {
                if (Flag_deletion)
                {
                    int id_Rol = Convert.ToInt32(TablaRoles.Rows[e.RowIndex]["id_Rol"].ToString());

                    switch (id_Rol)
                    {
                    case 1:
                        MessageBox.Show("El Rol Afiliado no debe ser modificado");
                        return;

                    case 2:
                        MessageBox.Show("El Rol Administrativo no debe ser modificado");
                        return;

                    case 3:
                        MessageBox.Show("El Rol Profesional no debe ser modificado");
                        return;
                    }

                    if (SQL_Methods.Rol_DarBaja(id_Rol))
                    {
                        MessageBox.Show(TablaRoles.Rows[e.RowIndex]["Nombre"].ToString() + " ha sido eliminado.");
                    }

                    FormularioRol.Visible = true;
                    this.Dispose();
                }
                else
                {
                    int id_Rol = Convert.ToInt32(TablaRoles.Rows[e.RowIndex]["id_Rol"].ToString());
                    new AddModRol(FormularioRol, id_Rol);
                    this.Dispose();
                }
            }
        }