Example #1
0
def attemptGatherAccountDetails(username):
    try:
        __linker = DBManager(user='******', password='******')
        workerDetails = __linker.getWorkerDetails(username)
        email = __linker.getAccountEmailAddress(username)
        companyInfo = __linker.getEnrolledCompanies(username)

        if companyInfo is not None:
            for index in range(len(companyInfo)):
                companyInfo[index] = (companyInfo[index][0],
                                      companyInfo[index][1],
                                      _encode64DecodeUTF8Image(
                                          companyInfo[index][2]))

        return {
            'success': True,
            'message': None,
            'parameters': {
                'firstName': workerDetails[0],
                'lastName': workerDetails[1],
                'city': workerDetails[2],
                'country': workerDetails[3],
                'address': workerDetails[4],
                'email': email,
                'companies': companyInfo
            }
        }
    except Exception as db_except:
        return {
            'success': False,
            'message': str(db_except),
            'parameters': None
        }
    finally:
        del __linker
Example #2
0
def attemptGatherWorkerDetails(username):
    try:
        __linker = DBManager(user='******', password='******')
        workerDetails = __linker.getWorkerDetails(username)
        return {
            'success': True,
            'message': None,
            'parameters': {
                'firstName': workerDetails[0],
                'lastName': workerDetails[1],
                'city': workerDetails[2],
                'country': workerDetails[3],
                'address': workerDetails[4]
            }
        }
    except Exception as db_except:
        return {
            'success': False,
            'message': str(db_except),
            'parameters': None
        }
    finally:
        del __linker