Commit 05d8ecc3 authored by Evenson Jeunesse's avatar Evenson Jeunesse

Update prog.py

parent f5ff8ed7
......@@ -186,20 +186,21 @@ def updateEspece(classe, nom, new_classe, new_nom):
print("An error occurs, please try again...")
return False
def updateClient(id, nom, prenom, dateNaissance, adresse, telephone):
sql = "UPDATE Clients SET nom='{}', prenom='{}', date_naissance=TO_DATE('{}', 'YYYY-MM-DD'), adresse='{}', telephone={} WHERE id={}".format( nom, prenom, dateNaissance, adresse, telephone, id)
def updateClient(idClient, nom, prenom, dateNaissance, adresse, telephone):
sql = "UPDATE Clients SET nom='{}', prenom='{}', date_naissance=TO_DATE('{}', 'YYYY-MM-DD'), adresse='{}', telephone={} WHERE id={}".format( nom, prenom, dateNaissance, adresse, telephone, idClient)
if Execute(sql):
print("Client updated successfully")
return True
print("An error occurs, please try again...")
return False
def updatePersonnel(id, nom, prenom, dateNaissance, adresse, telephone, specialite, isVeterinaire) :
def updatePersonnel(idPersonnel, 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)
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, idPersonnel)
if Execute(sql):
if isVeterinaire :
......@@ -210,10 +211,9 @@ def updatePersonnel(id, nom, prenom, dateNaissance, adresse, telephone, speciali
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)
def updateAnimal(idAnimal, nom, dernierPoids, dernierTaille, dateNaissance, espece) :
sql = "UPDATE Animaux SET nom='{}', dernierPoids={}, derniereTaille={}, date_naissance={}, espece='{}' WHERE id={}".format(nom, dernierPoids, dernierTaille, dateNaissance, espece, idAnimal)
if Execute(sql):
print("Animal updated successfully")
return True
......
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