def refreshBronze(self): try: cursor = self.data.cursor() if self.ui.radioButton_insert.isChecked(): equipeBronze = cursor.execute( "SELECT numIn FROM lesInscriptions WHERE numEp=? AND numIn<>? AND numIn<>?", [ self.ui.comboBox_numEp.currentText(), self.ui.comboBox_gold.currentText(), self.ui.comboBox_silver.currentText() ]) elif self.ui.radioButton_update.isChecked(): equipeBronze = cursor.execute( "SELECT numIn FROM lesInscriptions WHERE numEp=? AND numIn<>(SELECT bronze from lesResultats where numEp=? and numIn<>? and numIn<>?)", [ self.ui.comboBox_numEp.currentText(), self.ui.comboBox_numEp.currentText(), self.ui.comboBox_gold.currentText(), self.ui.comboBox_silver.currentText() ]) else: equipeBronze = cursor.execute( "SELECT bronze FROM lesResultats WHERE numEp=?", [self.ui.comboBox_numEp.currentText()]) except Exception as e: display.refreshLabel(self.ui.label_erreur, "Impossible de gerer les places : " + repr(e)) else: display.refreshGenericCombo(self.ui.comboBox_bronze, equipeBronze)
def init(self): self.ui.numIn_Ajout.clear() self.ui.numIn_Modification.clear() self.ui.numIn_Suppression.clear() self.ui.numEp_Ajout.clear() self.ui.numEp_Modification.clear() self.ui.numEp_Suppression.clear() # Chargements des inscrits try: cursor = self.data.cursor() result = cursor.execute( "SELECT distinct numEq FROM LesEquipes UNION SELECT distinct numSp FROM LesSportifs ") except Exception : display.refreshLabel(self.ui.titre, "Impossible de récupérer les sportifs et les équipes pour l'ajout : " + repr(e)) else: display.refreshGenericCombo(self.ui.numIn_Ajout, result) # Chargements des epreuves try: cursor = self.data.cursor() result = cursor.execute("SELECT distinct numEp FROM LesEpreuves") except Exception : display.refreshLabel(self.ui.titre, "Impossible de récupérer les épreuves : " + repr(e)) else: for row_num, row_data in enumerate(result): self.ui.numEp_Ajout.addItem(str(row_data[0])) self.ui.numEp_Modification.addItem(str(row_data[0])) self.ui.numEp_Suppression.addItem(str(row_data[0]))
def refreshNoDos(self): try: cursor = self.data.cursor() result = cursor.execute("SELECT noDos FROM LesDossiers_base ") except Exception as e: self.ui.NoDos_fct_combo_8_5.clear() else: display.refreshGenericCombo(self.ui.NoDos_fct_combo_8_5, result)
def refreshSpec_suppr_List(self): try: cursor = self.data.cursor() result = cursor.execute("SELECT nomSpec FROM LesSpectacles") except Exception as e: self.ui.comboBox_suppr_fct_comp_7.clear() else: display.refreshGenericCombo(self.ui.comboBox_suppr_fct_comp_7, result)
def refreshNoSpec(self): try: cursor = self.data.cursor() result = cursor.execute("SELECT DISTINCT noSpec FROM LesTickets ") except Exception as e: self.ui.noSpec_fct_combo.clear() else: display.refreshGenericCombo(self.ui.noSpec_fct_combo, result)
def refreshNoRang(self): try: cursor = self.data.cursor() result = cursor.execute("SELECT DISTINCT noRang FROM lesPlaces ") except Exception as e: self.ui.NoRang_fct_combo_8_3.clear() else: display.refreshGenericCombo(self.ui.NoRang_fct_combo_8_3, result)
def refreshcomboSpec(self): try: cursor = self.data.cursor() result = cursor.execute("SELECT noSpec FROM LesSpectacles ") except Exception as e: self.ui.NoSpec_fct_combo_8_1.clear() else: display.refreshGenericCombo(self.ui.NoSpec_fct_combo_8_1, result)
def refreshCatList(self): try: cursor = self.data.cursor() result = cursor.execute("SELECT DISTINCT pays FROM LesSportifs_base ORDER BY pays") except Exception as e: self.ui.comboBox_fct_4_pays.clear() else: display.refreshGenericCombo(self.ui.comboBox_fct_4_pays, result)
def refreshNoDosList(self): try: cursor = self.data.cursor() result = cursor.execute("SELECT noDos FROM LesDossiers") except Exception as e: self.ui.comboBox_4_noDossier.clear() else: display.refreshGenericCombo(self.ui.comboBox_4_noDossier, result)
def refreshCatList(self): try: cursor = self.data.cursor() result = cursor.execute("SELECT catZone FROM LesZones") except Exception as e: self.ui.comboBox_4_categorie.clear() else: display.refreshGenericCombo(self.ui.comboBox_4_categorie, result)
def refreshLibelleCat(self): try: cursor = self.data.cursor() result = cursor.execute( "SELECT libelleCat FROM LesCategoriesTickets ") except Exception as e: self.ui.fct_combo_8_12.clear() else: display.refreshGenericCombo(self.ui.fct_combo_8_12, result)
def refreshCatList(self): try: cursor = self.data.cursor() result = cursor.execute( "SELECT DISTINCT catZone FROM LesTickets NATURAL JOIN LesPlaces NATURAL JOIN LesZones WHERE noDos = ?", [self.ui.comboBox.currentText()]) except Exception as e: self.ui.comboBox_4_categorie.clear() else: display.refreshGenericCombo(self.ui.comboBox_4_categorie, result)
def refreshCatList(self): try: cursor = self.data.cursor() result = cursor.execute("SELECT catZone FROM LesZones") except Exception as e: self.ui.comboBox_fct_comp_3.clear() display.refreshLabel(self.ui.label_fct_comp_3, "Aucune catégorie trouvée") else: display.refreshGenericCombo(self.ui.comboBox_fct_comp_3, result)
def refreshNoPlace(self): try: cursor = self.data.cursor() result = cursor.execute( "SELECT DISTINCT noPlace FROM LesPlaces WHERE noRang = ?", [self.ui.NoRang_fct_combo_8_3.currentText()]) except Exception as e: self.ui.NoPlace_fct_combo_8_4.clear() else: display.refreshGenericCombo(self.ui.NoPlace_fct_combo_8_4, result)
def refreshDateRep(self): try: cursor = self.data.cursor() result = cursor.execute( "SELECT DISTINCT dateRep FROM LesRepresentations_base WHERE noSpec = ?", [self.ui.NoSpec_fct_combo_8_1.currentText()]) except Exception as e: self.ui.dateRep_fct_combo_8_2.clear() else: display.refreshGenericCombo(self.ui.dateRep_fct_combo_8_2, result)
def refreshCombobox(self): try: cursor = self.data.cursor() result = cursor.execute( "SELECT DISTINCT numEq FROM LesEquipiers JOIN LesSportifs USING(numSp) where pays= ?", [self.ui.comboBox_fct_4_pays.currentText()]) except Exception as e: self.ui.comboBox_fct_4_equipe.clear() else: display.refreshGenericCombo(self.ui.comboBox_fct_4_equipe, result)
def refreshReducList(self): try: cursor = self.data.cursor() result = cursor.execute( "SELECT libelleCat FROM LesCategoriesTickets") except Exception as e: self.ui.comboBox_redu_fct_comp_8.clear() else: display.refreshGenericCombo(self.ui.comboBox_redu_fct_comp_8, result)
def refreshDateRep(self): try: cursor = self.data.cursor() result = cursor.execute( "SELECT DISTINCT dateRep FROM LesTickets WHERE noSpec = ?", [self.ui.noSpec_fct_combo.currentText()]) except Exception as e: self.ui.dateRep_fct_combo.clear() else: display.refreshGenericCombo(self.ui.dateRep_fct_combo, result)
def refreshCatList(self): try: cursor = self.data.cursor() result = cursor.execute( "SELECT DISTINCT categorieEp FROM LesEpreuves ORDER BY categorieEp" ) except Exception as e: self.ui.comboBox_fct_comp_3.clear() else: display.refreshGenericCombo(self.ui.comboBox_comp_3, result)
def changedModification(self): try: cursor = self.data.cursor() result = cursor.execute("SELECT distinct numIn FROM LesInscriptions WHERE numEp = ?", [self.ui.numEp_Modification.currentText()]) except Exception as e: display.refreshLabel(self.ui.titre, "Erreur de chargement des champs modification : Inscrits : " + repr(e)) else: display.refreshGenericCombo(self.ui.numIn_Modification, result)
def refreshCatList2(self): display.refreshLabel(self.ui.label_fct_comp_4, "Choisir le equipe") try: cursor = self.data.cursor() result = cursor.execute( "SELECT DISTINCT E.numEq FROM LesSportifs_base S LEFT OUTER JOIN LesEquipiers E ON S.numSp=E.numSp WHERE pays=?", [self.ui.comboBox_fct_4_pays.currentText()]) except Exception as e: self.ui.comboBox_fct_4_equipe.clear() else: display.refreshGenericCombo(self.ui.comboBox_fct_4_equipe, result)
def refreshRepr_suppr_List(self): try: cursor = self.data.cursor() # requête avec paramètre '?' result = cursor.execute( "SELECT dateRep FROM LesRepresentations NATURAL JOIN LesSpectacles WHERE nomSpec = ? ", [str(self.ui.comboBox_suppr_fct_comp_7.currentText())]) except Exception as e: self.ui.comboBox_suppr_fct_comp_7_2.clear() else: display.refreshGenericCombo(self.ui.comboBox_suppr_fct_comp_7_2, result)
def init(self, updateLabel): self.ui.numEpAjout.clear() self.ui.orAjout.clear() self.ui.argentAjout.clear() self.ui.bronzeAjout.clear() self.ui.numEpModif.clear() self.ui.numEpSupp.clear() if updateLabel: display.refreshLabel(self.ui.label_fct_part3_2, "") try: cursor = self.data.cursor() result = cursor.execute("SELECT numEp FROM LesEpreuves") except Exception as e: if updateLabel: display.refreshLabel( self.ui.label_fct_part3_2, "Impossible de récupérer les épreuves : " + repr(e)) return else: display.refreshGenericCombo(self.ui.numEpAjout, result) try: cursor = self.data.cursor() result = cursor.execute( "SELECT numEq as numIn FROM LesEquipes UNION SELECT numSp as numIn FROM LesSportifs" ) except Exception as e: if updateLabel: display.refreshLabel( self.ui.label_fct_part3_2, "Impossible de récupérer les participants : " + repr(e)) return else: for row_num, row_data in enumerate(result): self.ui.orAjout.addItem(str(row_data[0])) self.ui.argentAjout.addItem(str(row_data[0])) self.ui.bronzeAjout.addItem(str(row_data[0])) try: cursor = self.data.cursor() result = cursor.execute("SELECT numEp FROM LesResultats") except Exception as e: if updateLabel: display.refreshLabel( self.ui.label_fct_part3_2, "Impossible de récupérer les résultats : " + repr(e)) return else: for row_num, row_data in enumerate(result): self.ui.numEpModif.addItem(str(row_data[0])) self.ui.numEpSupp.addItem(str(row_data[0]))
def listCat(self): try: cursor = self.data.cursor() requete = "SELECT distinct categorieEp FROM lesEpreuves" categories = cursor.execute(requete) except Exception as e: display.refreshLabel( self.ui.label_fct_comp_3, "Impossible d'afficher les résultats : " + repr(e)) self.ui.comboBox_fct_comp_3.clear() else: display.refreshGenericCombo(self.ui.comboBox_fct_comp_3, categories)
def refreshDateList(self): try: cursor = self.data.cursor() result = cursor.execute( "SELECT dateRep FROM LesRepresentations " "NATURAL JOIN LesSpectacles " "WHERE nomSpec = ? " "AND nbPlacesDispoRep > 0", [self.ui.comboBox_spec_fct_comp_8.currentText()]) except Exception as e: self.ui.comboBox_date_fct_comp_8.clear() else: display.refreshGenericCombo(self.ui.comboBox_date_fct_comp_8, result)
def refreshLibelleCat(self): try: cursor = self.data.cursor() result = cursor.execute( "SELECT libelleCat FROM LesTickets WHERE noSpec = ? AND dateRep = ? AND noPlace = ? AND noRang = ?", [ self.ui.noSpec_fct_combo.currentText(), self.ui.dateRep_fct_combo.currentText(), self.ui.noPlace_fct_combo.currentText(), self.ui.noRang_fct_combo.currentText() ]) except Exception as e: self.ui.libelleCat_fct_combo.clear() else: display.refreshGenericCombo(self.ui.libelleCat_fct_combo, result)
def init(self): display.refreshLabel(self.ui.label_fct_part3_2_modif, "") try: cursor = self.data.cursor() result = cursor.execute("SELECT numEp FROM LesEpreuves") except Exception as e: display.refreshLabel( self.ui.label_fct_part3_2_modif, "Impossible de récupérer les épreuves : " + repr(e)) return else: display.refreshGenericCombo(self.ui.numEpModif, result) try: cursor = self.data.cursor() result = cursor.execute( "SELECT numEq as numIn FROM LesEquipes UNION SELECT numSp as numIn FROM LesSportifs" ) except Exception as e: display.refreshLabel( self.ui.label_fct_part3_2_modif, "Impossible de récupérer les participants : " + repr(e)) return else: for row_num, row_data in enumerate(result): self.ui.orModif.addItem(str(row_data[0])) self.ui.argentModif.addItem(str(row_data[0])) self.ui.bronzeModif.addItem(str(row_data[0])) try: cursor = self.data.cursor() result = cursor.execute( "SELECT gold, silver, bronze FROM LesResultats WHERE numEp = ?", [self.numEp]) except Exception as e: display.refreshLabel( self.ui.label_fct_part3_2_modif, "Impossible de récupérer les résultats : " + repr(e)) return else: for row_num, row_data in enumerate(result): self.ui.orModif.setCurrentText(str(row_data[0])) self.ui.argentModif.setCurrentText(str(row_data[1])) self.ui.bronzeModif.setCurrentText(str(row_data[2])) self.ui.numEpModif.setCurrentText(self.numEp)
def __init__(self, data: sqlite3.Connection): super(QDialog, self).__init__() self.ui = uic.loadUi("gui/fct_comp_3.ui", self) self.data = data try: cursor = self.data.cursor() result = cursor.execute( "SELECT DISTINCT categorieEp FROM LesEpreuves") except Exception as e: display.refreshLabel( self.ui.label_fct_comp_3, "Impossible de récupérer la liste des catégories : " + repr(e)) else: display.refreshGenericCombo(self.ui.comboBox_fct_comp_3, result) if self.ui.comboBox_fct_comp_3.count() == 0: display.refreshLabel(self.ui.label_fct_comp_3, "Aucune catégorie disponible")
def refreshSpecList(self): try: cursor = self.data.cursor() result = cursor.execute( "SELECT DISTINCT nomSpec FROM LesSpectacles " "NATURAL JOIN LesRepresentations " "WHERE nbPlacesDispoRep > 0") except Exception as e: self.ui.comboBox_spec_fct_comp_8.clear() else: display.refreshGenericCombo(self.ui.comboBox_spec_fct_comp_8, result) if self.ui.comboBox_spec_fct_comp_8.currentText() == '': display.refreshLabel(self.ui.label_error_fct_comp_8, "Il n'y a plus de places disponibles.") for a in self.addelements: a.setEnabled(False) if a != self.ui.pushButton_ajout_fct_comp_8: a.clear()
def refreshRowList(self): try: cursor = self.data.cursor() result = cursor.execute( "SELECT DISTINCT noRang " "FROM LesPlaces " "WHERE noPlace || '_' || noRang " "NOT IN ( " "SELECT noPlace || '_' || noRang " "FROM LesTickets " "NATURAL JOIN LesSpectacles " "WHERE nomSpec = ? AND dateRep = ? " ") " "ORDER BY noRang", [ self.ui.comboBox_spec_fct_comp_8.currentText(), self.ui.comboBox_date_fct_comp_8.currentText() ]) except Exception as e: self.ui.comboBox_rang_fct_comp_8.clear() else: display.refreshGenericCombo(self.ui.comboBox_rang_fct_comp_8, result)