public void Initialize() { //Arrange var databaseFactory = new DatabaseFactory(); _unitOfWork = new UnitOfWork(databaseFactory); _settingRepository = new SettingRepository(databaseFactory); _employeeInfoRepository = new EmployeeInfoRepository(databaseFactory); _employeeDeductionRepository = new EmployeeDeductionRepository(databaseFactory); _deductionRepository = new DeductionRepository(databaseFactory); _employeePayrollRepository = new EmployeePayrollRepository(databaseFactory); _employeePayrollDeductionRepository = new EmployeePayrollDeductionRepository(databaseFactory); _taxRepository = new TaxRepository(databaseFactory); _totalEmployeeHoursRepository = new TotalEmployeeHoursRepository(databaseFactory); _settingService = new SettingService(_settingRepository); _employeeSalaryService = new EmployeeSalaryService(); _employeeInfoService = new EmployeeInfoService(_employeeInfoRepository); _employeeDeductionService = new EmployeeDeductionService(_employeeDeductionRepository); _deductionService = new DeductionService(_deductionRepository); _totalEmployeeHoursService = new TotalEmployeeHoursService(_unitOfWork, _totalEmployeeHoursRepository, null, _settingService); _taxService = new TaxService(_taxRepository); _employeePayrollDeductionService = new EmployeePayrollDeductionService(_unitOfWork, _settingService, _employeeSalaryService, _employeeInfoService, _employeeDeductionService, _deductionService, _employeePayrollDeductionRepository, _taxService); }
public void Initialize() { //Arrange var databaseFactory = new DatabaseFactory(); _unitOfWork = new UnitOfWork(databaseFactory); _employeeDailyPayrollRepository = new EmployeeDailyPayrollRepository(databaseFactory); _employeePayrollRepository = new EmployeePayrollRepository(databaseFactory); _settingRepository = new SettingRepository(databaseFactory); _employeePayrollDeductionRepository = new EmployeePayrollDeductionRepository(databaseFactory); _employeeInfoRepository = new EmployeeInfoRepository(databaseFactory); _totalEmployeeHoursRepository = new TotalEmployeeHoursRepository(databaseFactory); _deductionRepository = new DeductionRepository(databaseFactory); _employeeDeductionRepository = new EmployeeDeductionRepository(databaseFactory); _taxRepository = new TaxRepository(databaseFactory); _employeeRepository = new EmployeeRepository(databaseFactory, null); _employeePayrollItemRepository = new EmployeePayrollItemRepository(databaseFactory); _employeeAdjustmentRepository = new EmployeeAdjustmentRepository(databaseFactory); _settingService = new SettingService(_settingRepository); _employeeDailyPayrollService = new EmployeeDailyPayrollService(_unitOfWork, null, null, null, null, _employeeDailyPayrollRepository, null, null); _employeeInfoService = new EmployeeInfoService(_employeeInfoRepository); _deductionService = new DeductionService(_deductionRepository); _employeeDeductionService = new EmployeeDeductionService(_employeeDeductionRepository); _taxService = new TaxService(_taxRepository); _employeePayrollDeductionService = new EmployeePayrollDeductionService(_unitOfWork, _settingService, null, _employeeInfoService, _employeeDeductionService, _deductionService, _employeePayrollDeductionRepository, _taxService); _employeeService = new EmployeeService(_employeeRepository); _totalEmployeeHoursService = new TotalEmployeeHoursService(_unitOfWork, _totalEmployeeHoursRepository, null, _settingService); _employeePayrollItemService = new EmployeePayrollItemService(_unitOfWork, _employeePayrollItemRepository, null, null, null, null, null, null, null, null, null, null, null); _employeeAdjusmentService = new EmployeeAdjustmentService(_employeeAdjustmentRepository, _employeeRepository); _employeePayrollAllowanceService = new EmployeePayrollAllowanceService(_settingService, _totalEmployeeHoursService); _employeePayrollService = new EmployeePayrollService(_unitOfWork, _employeePayrollRepository, _settingService, _employeePayrollDeductionService, _employeeInfoService, _totalEmployeeHoursService, _employeeService, _totalEmployeeHoursService, _employeePayrollItemService, _employeeAdjusmentService, _employeePayrollAllowanceService); //Update settings var settingsPayrollStartDate = _settingRepository.GetSettingByKey("PAYROLL_WEEK_START"); _settingRepository.Update(settingsPayrollStartDate); settingsPayrollStartDate.Value = "3"; var settingsPayrollEndDate = _settingRepository.GetSettingByKey("PAYROLL_WEEK_END"); _settingRepository.Update(settingsPayrollEndDate); settingsPayrollEndDate.Value = "2"; var settingsPayrollReleaseDate = _settingRepository.GetSettingByKey("PAYROLL_WEEK_RELEASE"); _settingRepository.Update(settingsPayrollReleaseDate); settingsPayrollReleaseDate.Value = "3"; _unitOfWork.Commit(); }
public EmployeePayrollDeductionService(IUnitOfWork unitOfWork, ISettingService settingService, IEmployeeSalaryService employeeSalaryService, IEmployeeInfoService employeeInfoService, IEmployeeDeductionService employeeDeductionService, IDeductionService deductionService, IEmployeePayrollDeductionRepository employeePayrollDeductionRepository, ITaxService taxService) { _unitOfWork = unitOfWork; _settingService = settingService; _employeeSalaryService = employeeSalaryService; _employeeInfoService = employeeInfoService; _employeeDeductionService = employeeDeductionService; _deductionService = deductionService; _employeePayrollDeductionRepository = employeePayrollDeductionRepository; _taxService = taxService; }
public EmployeeController(IUnitOfWork unitOfWork, IEmployeeRepository employeeRepository, IEmployeeInfoRepository employeeInfoRepository, ISettingRepository settingRepository, IPositionRepository positionRepository, IEmployeeLoanRepository employeeLoanRepository, IWebService webService, IDepartmentRepository departmentRepository, ILoanRepository loanRepository, IEmployeeInfoHistoryRepository employeeInfoHistoryRepository, IEmployeeLeaveRepository employeeLeaveRepository, ILeaveRepository leaveRepository, IDeductionRepository deductionRepository, IEmployeeDeductionService employeeDeductionService, IEmployeeWorkScheduleService employeeWorkScheduleService, IWorkScheduleRepository workScheduleRepository) { _unitOfWork = unitOfWork; _employeeRepository = employeeRepository; _settingRepository = settingRepository; _employeeInfoRepository = employeeInfoRepository; _positionRepository = positionRepository; _webService = webService; _employeeLoanRepository = employeeLoanRepository; _departmentRepository = departmentRepository; _loanRepository = loanRepository; _employeeInfoHistoryRepository = employeeInfoHistoryRepository; _employeeLeaveRepository = employeeLeaveRepository; _leaveRepository = leaveRepository; _deductionRepository = deductionRepository; _employeeDeductionService = employeeDeductionService; _employeeWorkScheduleService = employeeWorkScheduleService; _workScheduleRepository = workScheduleRepository; }