public EmployeeFactory GetEmployee(int id, string name, string contractTypeName, int roleId, string roleName, string roleDescription, decimal hourlySalary, decimal monthlySalary)
        {
            EmployeeFactory employeeFactory = null;

            switch (contractTypeName.ToLower())
            {
            case "hourlysalaryemployee":
                employeeFactory = new EmployeeHourlySalary(id,
                                                           name,
                                                           contractTypeName,
                                                           roleId,
                                                           roleName,
                                                           roleDescription,
                                                           hourlySalary,
                                                           monthlySalary);
                break;

            case "monthlysalaryemployee":
                employeeFactory = new EmployeeMonthlySalary(id,
                                                            name,
                                                            contractTypeName,
                                                            roleId,
                                                            roleName,
                                                            roleDescription,
                                                            hourlySalary,
                                                            monthlySalary);
                break;
            }
            return(employeeFactory);
        }
Example #2
0
        public void Initialize()
        {
            _employeeContext = GetDbContext();

            IEmployeeService employeeService = new EmployeeService(_employeeContext);

            _employeeHourlySalary = new EmployeeHourlySalary(employeeService);
        }