Commit 4d3a2b05 authored by Xiang Li's avatar Xiang Li

Update prog.py

parent fdfeae30
......@@ -267,15 +267,69 @@ def deleteEspece(nom):
conn.commit()
print("Delete Espece Succes")
def deleteClient(id)
def deletePersonnel(id)
def deleteAnimal(id)
def deleteProprietaire(id)
def deleteMedicament(id)
def deleteAutorise(id)
def deleteTraitement(nom, debut, duree, veterinaire_id, animal_id)
def deletePrescription(traitement_id, medicament_id, quantite)
def deleteAnimal(name)
def deleteClient(idClient):
sql = "DELETE FROM Clients WHERE id={};".format(idClient)
if(Execute(sql)):
print("Delete Client Succes")
else:
print("Delete Client Fail")
def deletePersonnel(idPersonnel, isVeterinaires):
table = 'Assistants'
if(isVeterinaires):
table = 'Veterinaires'
sql = "DELETE FROM {} WHERE id={};".format(table, idPersonnel)
if(Execute(sql)):
print("Delete {} Succes".format(table))
else:
print("Delete Veterinaire Fail")
def deleteAnimal(idAnimal):
sql = "DELETE FROM Animaux WHERE id={};".format(idAnimal)
if(Execute(sql)):
print("Delete Animal Succes")
else:
print("Delete Animal Fail")
def deleteProprietaire(idClient, idAnimal):
sql = "DELETE FROM Proprietaires WHERE client={} AND animal={};".format(idClient, idAnimal)
if(Execute(sql)):
print("Delete Proprietaire Succes")
else:
print("Delete Proprietaire Fail")
def deleteMedicament(nomMolecule):
sql = "DELETE FROM Medicaments WHERE nomMolecule='{}';".format(nomMolecule)
if(Execute(sql)):
print("Delete Medicament Succes")
else:
print("Delete Medicament Fail")
def deleteAutorise(nomMolecule, nomEspece):
sql = "DELETE FROM Autorises WHERE medicament='{}' AND espece='{}';".format(nomMolecule, nomEspece)
if(Execute(sql)):
print("Delete Autorise Succes")
else:
print("Delete Autorise Fail")
def deleteTraitement(idTraitement):
sql = "DELETE FROM Traitements WHERE id={};".format(idTraitement)
if(Execute(sql)):
print("Delete Traitement Succes")
else:
print("Delete Traitement Fail")
def deletePrescription(idTraitement, nomMolecule):
sql = "DELETE FROM Prescriptions WHERE traitement={} AND medicament='{}';".format(idTraitement, nomMolecule)
if(Execute(sql)):
print("Delete Prescription Succes")
else:
print("Delete Prescription Fail")
"""
///////////////////////////////////////////////////////////////////////////
......
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