Пример #1
0
        public static HandlerDataConnection getInstance()
        {
            if (_instance == null)
            {
                _instance = new HandlerDataConnection();
            }

            return(_instance);
        }
Пример #2
0
        public async Task <List <EmployeeDto> > getAllEmployeesDto()
        {
            var employees = await HandlerDataConnection.getInstance().GetAllEmployees();

            this.employeesDto = employees.Select(emp => {
                EmployeeDto employeeDto = null;
                switch (emp.contractTypeName)
                {
                case HOURLY_SALARY_EMPLOYEE:
                    employeeDto = this.factoryHourlyEmployee.createEmployee(emp);
                    break;

                case MONTHLY_SALARY_EMPLOYEE:
                    employeeDto = this.factoryMonthlyEmployee.createEmployee(emp);
                    break;
                }
                return(employeeDto);
            }).ToList();


            return(this.employeesDto);
        }