예제 #1
0
        public IEmployeeSalaryManager GetEmployeeSalaryManager(String emptype)
        {
            IEmployeeSalaryManager ReturnValue = null;

            if (emptype == "permanent")
            {
                ReturnValue = new PermanentEmployeeSalaryManager();
            }
            if (emptype == "contract")
            {
                ReturnValue = new ContractEmployeeSalaryManager();
            }
            return(ReturnValue);
        }
예제 #2
0
 public void UpdateEmployee(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.UpdateEmployee(emp);
 }