예제 #1
0
        public EmployeeDTO GetEmployeeById(int pId)
        {
            var employee = dataClient.GetEmployeeById(pId);

            if (employee != null)
            {
                return(EmployeeFactory.GetEmployeeBySalaryType(employee));
            }
            else
            {
                throw new EmployeeNotFoundException("Employee not found");
            }
        }
예제 #2
0
        public List <EmployeeDTO> GetEmployees()
        {
            List <EmployeeDTO> employeeList = new List <EmployeeDTO>();

            var employees = dataClient.GetEmployees();

            if (employees != null)
            {
                foreach (var employee in employees)
                {
                    employeeList.Add(EmployeeFactory.GetEmployeeBySalaryType(employee));
                }
            }

            return(employeeList);
        }