Пример #1
0
 def CallBackFormulaireAdh(): #Fonction de confirmation DANS la fonction de fenetre.
     #recupere les infos 
     infoAdh.append(entryNomAdh.get())
     infoAdh.append(entryPrenomAdh.get())
     infoAdh.append(entryPseudoAdh.get())
     if(modification == -1):
             infoAdh.append(entryMdpAdh.get())
     else:
         infoAdh.append(None)
     j = int(entryDnjAdh.get())
     m = int(entryDnmAdh.get())
     a = int(entryDnaAdh.get())
     d = datetime.datetime(a, m, j)
     infoAdh.append(d)
     infoAdh.append(entryAdrAdh.get())
     infoAdh.append(entryVilleAdh.get())
     infoAdh.append(entryCpAdh.get())
     infoAdh.append(entryNumAdh.get())
     infoAdh.append(entryMailAdh.get())
     if(cocher.get()==1):
         infoAdh.append(True)
     else:
         infoAdh.append(False)
     
     #ordre infoAdh : nom,prenom,pseudo,mdp,dateNaissance,adresse,ville,codepostale,numTel,@Mail,estAdmin
     #on modifie un adherent
     if(modification<>1):
         if (askyesno("Confirmation", "Enregistrer vos modification")):
             Adherent.setNom(numAdh,infoAdh[0])
             Adherent.setPrenom(numAdh,infoAdh[1])
             Adherent.setPseudo(numAdh,infoAdh[2])
             if modification == -1:
                 Adherent.setMotDePasse(numAdh,infoAdh[3])
             Adherent.setNaissance(numAdh,infoAdh[4])
             Adherent.setAdresse(numAdh,infoAdh[5])
             Adherent.setVille(numAdh,infoAdh[6])
             Adherent.setCodePostale(numAdh,infoAdh[7])
             Adherent.setNumeroTelephone(numAdh,infoAdh[8])
             Adherent.setMail(numAdh,infoAdh[9])
             if modification == 0:
                 Adherent.setAdministrateur(numAdh,infoAdh[10])
             return fAdh.quit() #Ferme si "oui"
         else:
             fAdh.destroy()
             return menu(num)
     #on creer un adherent
     else:    
         if (askyesno("Confirmation", "Creer ce nouveau adherent ?")):
             #ajoutAdherent(nomAdherent, prenomAdherent, dateNaissanceAdherent, adresseAdherent, codePostalAdherent, villeAdherent, numeroTelAdherent,  pseudoAdherent, adresseMailAdherent, estAdmin)
             Adherent.ajoutAdherent(infoAdh[0],infoAdh[1],infoAdh[4],infoAdh[5],infoAdh[7],infoAdh[6],infoAdh[8],infoAdh[2],infoAdh[9],infoAdh[10])
             return fAdh.quit() #Ferme si "oui"
         else:
             fAdh.destroy()
             return menu(num)