Commit f2a017f1 authored by Evenson Jeunesse's avatar Evenson Jeunesse

Update prog.py

parent b025f0e3
......@@ -22,7 +22,6 @@ while raw:
print (raw[1])
raw = cur.fetchone()
#////////// BOUCLE PRINCIPALE /////////////////
......@@ -31,9 +30,6 @@ while raw:
# Close connection
conn.close()
......@@ -164,9 +160,33 @@ def updateClient(id, nom, prenom, dateNaissance, adresse, telephone):
return True
print("An error occurs, please try again...")
return False
def updatePersonnel(id, nom, prenom, dateNaissance, adresse, telephone, specialite, isVeterinaire) :
table = 'Assistants'
if isVeterinaire :
table = 'Veterinaires'
sql = "UPDATE {} SET nom='{}', prenom='{}', date_naissance=TO_DATE('{}', 'YYYY-MM-DD'), adresse='{}', telephone={}, specialite='{}' WHERE id={}".format(table, nom, prenom, dateNaissance, adresse, telephone,specialite, id)
if Execute(sql):
if isVeterinaire :
print("Veterinaire updated successfully")
else:
print("Assistant updated successfully")
return True
print("An error occurs, please try again...")
return False
def updateAnimal(id, nom, dernierPoids, dernierTaille, dateNaissance, espece) :
sql = "UPDATE Animaux SET nom='{}', dernierPoids={}, derniereTaille={}, date_naissance={}, espece='{}' WHERE id={}".format(nom, dernierPoids, dernierTaille, dateNaissance, espece, id)
if Execute(sql):
print("Animal updated successfully")
return True
print("An error occurs, please try again...")
return False
def updatePersonnel(nom, prenom, dateNaissance, adresse, telephone, specialite, role)
def updateAnimal(nom, dernierPoids, dernierTaille, dateNaissance, espece)
def updateProprietaire(client_id, animal_id)
def updateMedicament(nomMolecule, effets)
def updateAutorise(medicament_id, espece_id)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment