Exemple #1
0
import hr2
import employees1
#добавили систему продуктивности
import productivity1
import contacts

manager = employees1.Manager(1, 'Mary Poppins', 3000)
manager.address = contacts.Address('121 Admin Rd', 'Concord', 'NH', '03301')
secretary = employees1.Secretary(2, 'John Smith', 1500)
secretary.address = contacts.Address('67 Paperwork Ave.', 'Manchester', 'NH',
                                     '03101')
sales_guy = employees1.SalesPerson(3, 'Kevin Bacon', 1000, 250)
factory_worker = employees1.FactoryWorker(2, 'Jane Doe', 40, 15)
temporary_secretary = employees1.TemporarySecretary(5, 'Robin Williams', 40, 9)
company_employees = [
    manager,
    secretary,
    sales_guy,
    factory_worker,
    temporary_secretary,
]
productivity_system = productivity1.ProductivitySystem()
productivity_system.track(company_employees, 40)
payroll_system = hr2.PayrollSystem()
payroll_system.calculate_payroll(company_employees)
import payroll as pay
import productivity as prod
import employee as emp
import contacts as con

manager = emp.Manager(1, 'Manager', weekly_salary=1000)
manager.address = con.Address(street='111 Manager\'s address',
                              city='M city',
                              state='M State',
                              zipcode='11111')

secretary = emp.Secretary(2, 'Secretary', weekly_salary=500)
secretary.address = con.Address(street='222 Secretary\'s address',
                                city='S city',
                                state='S State',
                                zipcode='22222')

sales_person = emp.SalesPerson(3,
                               'Sales Guy',
                               weekly_salary=400,
                               commission=200)
sales_person.address = con.Address(street='333 Sales\'s address',
                                   city='Sales city',
                                   state='Sales State',
                                   zipcode='33333')

factory_worker = emp.FactoryWorker(4,
                                   'Factory Worker',
                                   hours_worked=40,
                                   hour_rate=10)
factory_worker.address = con.Address(street='444 Factory Worker\'s address',
Exemple #3
0
import hr
import employees
import productivity
import contacts

manager = employees.Manager(1, 'Jose Contreras', 1500)
manager.address = contacts.Address('121 Admin Road', 'Concord', 'NH', '03301')

secretary = employees.Secretary(1, 'Laura Vergara', 750)
secretary.address = contacts.Address('121 Admin Road', 'Concord', 'NH',
                                     '03301')

sales_guy = employees.SalesPerson(3, 'Pablo Espinoza', 1000, 250)
factory_worker = employees.FactoryWorker(4, 'Gustavo Cumare', 40, 20)
temporary_secretary = employees.TemporarySecretary(5, 'Fabiola Barrueta', 40,
                                                   9)

# we comment this because Employee is an Abstract Class, so It can be instaciated
# generic_employee = hr.Employee(4, 'Generic Employee')

employees_list = [
    manager, secretary, sales_guy, factory_worker, temporary_secretary
]

productivity_system = productivity.ProductivitySystem()
productivity_system.track(employees_list, 40)

payroll_system = hr.PayrollSystem()
payroll_system.calculate_payroll(employees_list)
Exemple #4
0
"""This is where the main app runs."""
import backtrace
import hr
import employees
import productivity
import contacts

print(employees.TempSecretary.__mro__)

# vadim = employees.Employee(1, 'vadim')
aaron = employees.Manager(2, 'aaron', 1000)
aarona = employees.Secretary(3, 'aarona', 100)
cheng = employees.FactoryWorker(4, 'cheng', 10, 40)
luo = employees.SalesPerson(5, 'luo', 500, 300)
joanna = employees.TempSecretary(6, 'joanna', 10, 30)

# here we're adding an address object to aaron's object. so object inside of obj.
aaron.address = contacts.Address('dzirnavu', 'riga',
                                 'soviet republic of latvia', '1010', '34a-15')

employees = [aaron, aarona, cheng, luo, joanna]

productivity_tracker = productivity.ProductivityTracker()
productivity_tracker.track(employees, 40)

payroll_system = hr.PayrollSystem()
payroll_system.calculate_payroll(employees)