Example #1
0
def SaveDataToFile():
    #Save data to file
    try:
        objF = DataProcessor.File()
        objF.FileName = "CustomerData.txt"
        objF.TextData = Customers.CustomerList.ToString()
        objF.SaveData()
    except Exception as e:
        print(e)
Example #2
0
def SaveDataToFile():
    try:
        objF = DataProcessor.File()
        objF.FileName = "CustomerData.txt"
        objF.TextData = Customers.CustomerList.ToString()
        print("Reached here")
        objF.SaveData()
    except Exception as e:
        print(e)
Example #3
0
def SaveDataToFile():
    try:
        objF = DataProcessor.File()
        objF.FileName = "EmployeeData.txt"
        objF.TextData = Employees.EmployeeList.ToString()
        print("Reached here")
        objF.SaveData()
    except Exception as e:
        print(e)
Example #4
0
def SaveDataToFile():
    try:
        objF = DataProcessor.File()
        # objF.FileName = "C:\_PythonClass\Module09\Assignment09\CustomerData.txt"
        objF.FileName = "CustomerData.txt"
        objF.TextData = Customers.CustomerList.ToString()
        print("Data was saved here, Congrats!!")
        objF.SaveData()
    except Exception as e:
        print(e)
Example #5
0
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 23 10:25:31 2017

@author: Emmanuel
"""
if __name__ == "__main__":
    import DataProcessor
else:
    raise Exception("This file was not created to be imported")


file = DataProcessor.File()
file.FileName = "Test.txt"
file.TextData = "Hello World"
print(file.SaveData())

print(file.ToString())
Example #6
0
import DataProcessor, Persons, Employees

print("Test the DataProcessor.File class")
objDP = DataProcessor.File()
objDP.FileName = "Test.txt"
objDP.TextData = "This is a test"
strMessage = objDP.SaveData()
print(strMessage)

print("\n Test the DataProcessor.Database class")
try:
    print("Trying to create an object, but the class is not ready")
    objDP = DataProcessor.Database()
except:
    print("This should fail")

print("\n Test the Persons.Person class")
objP = Persons.Person()
objP.FirstName = "Bob"
objP.LastName = "Smith"
print(objP.ToString())

print("\n Test the Employees.Employee class")
objE = Employees.Employee(1, "Bob")
# objE.Id = 1
# objE.FirstName = "Bob"
# objE.LastName = "Smith"
print(objE.ToString())

print("\n Test the Employee.EmployeeList class")
objEL = Employees.EmployeeList()