Ejemplo n.º 1
0
        public int SaveEmployee(Models.Employee employee)
        {
            EmployeeManagerFactory factory = new EmployeeManagerFactory();
            IEmployeeManager       manager = factory.GetManager(employee.EmployeeType.EmployeeTypeId);

            employee.HourlyPay = manager.GetHourlyPay();
            employee.BonusRate = manager.GetBonusRate();
            return(commandRepository.SaveEmployee(employee));
        }
Ejemplo n.º 2
0
 public void SaveEmployee(Employee emp)
 {
     if (emp.EmployeeTypeId == 1)
     {
         PermanentEmployeeSalaryManager pe = new PermanentEmployeeSalaryManager();
         emp.HourlyPay = pe.CalculateHourlyPay();
         emp.BonusRate = pe.CalculateBonusRate();
     }
     else if (emp.EmployeeTypeId == 2)
     {
         ContractEmployeeSalaryManager ce = new ContractEmployeeSalaryManager();
         emp.HourlyPay = ce.CalculateHourlyPay();
         emp.BonusRate = ce.CalculateBonusRate();
     }
     commandRepository.SaveEmployee(emp);
 }
Ejemplo n.º 3
0
 public void SaveEmployee(Employee emp)
 {
     commandRepository.SaveEmployee(emp);
 }