コード例 #1
0
ファイル: ClinicService.py プロジェクト: heyhellomila/soen344
def createClinic(name, address):
    response = False
    if (clinicExistsByData(name, address)):
        response = False
    else:
        ClinicTDG.create(name, address)
        response = True
    return response
コード例 #2
0
ファイル: ClinicService.py プロジェクト: heyhellomila/soen344
def deleteClinic(id):
    response = False
    if (getClinicById(id) is None):
        response = False
    else:
        ClinicTDG.delete(id)
        response = True
    return response
コード例 #3
0
ファイル: ClinicService.py プロジェクト: heyhellomila/soen344
def updateClinic(id, name, address):
    ClinicTDG.update(id, name, address)
    updatedClinic = ClinicTDG.find(id)
    if ((updatedClinic.name == name) & (updatedClinic.address == address)):
        return True
    return False
コード例 #4
0
ファイル: ClinicService.py プロジェクト: heyhellomila/soen344
def getClinicById(id):
    clinic = ClinicTDG.find(id)
    if clinic is not None:
        return dict(clinic)
    else:
        return None
コード例 #5
0
ファイル: ClinicService.py プロジェクト: heyhellomila/soen344
def clinicExistsByData(name, address):
    clinic = ClinicTDG.findByData(name, address)
    if clinic is not None:
        return True
    return False
コード例 #6
0
ファイル: ClinicService.py プロジェクト: heyhellomila/soen344
def clinicExistsById(id):
    clinic = ClinicTDG.find(id)
    if clinic is not None:
        return True
    return False
コード例 #7
0
ファイル: ClinicService.py プロジェクト: heyhellomila/soen344
def getAllClinics():
    listOfClinics = []
    clinics = ClinicTDG.findAll()
    for clinic in clinics:
        listOfClinics.append(dict(clinic))
    return listOfClinics
コード例 #8
0
ファイル: ClinicService.py プロジェクト: heyhellomila/soen344
def getClinicByData(name, address):
    clinic = ClinicTDG.findByData(name, address)
    if clinic is not None:
        return dict(clinic)
    return False