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 EmployeePayrollSchedule()
        {
            _employeeDepartmentRepository       = new EmployeeDepartmentRepository(_databaseFactory);
            _employeeRepository                 = new EmployeeRepository(_databaseFactory, _employeeDepartmentRepository);
            _attendanceRepository               = new AttendanceRepository(_databaseFactory);
            _attendanceLogRepository            = new AttendanceLogRepository(_databaseFactory, _employeeRepository);
            _settingRepository                  = new SettingRepository(_databaseFactory);
            _employeeWorkScheduleRepository     = new EmployeeWorkScheduleRepository(_databaseFactory);
            _employeeInfoRepository             = new EmployeeInfoRepository(_databaseFactory);
            _frequencyRepository                = new FrequencyRepository(_databaseFactory);
            _paymentFrequencyRepository         = new PaymentFrequencyRepository(_databaseFactory);
            _employeePayrollRepository          = new EmployeePayrollRepository(_databaseFactory);
            _employeePayrollDeductionRepository = new EmployeePayrollDeductionRepository(_databaseFactory);
            _employeeDailyPayrollRepository     = new EmployeeDailyPayrollRepository(_databaseFactory);
            _employeeHoursRepository            = new EmployeeHoursRepository(_databaseFactory);
            _totalEmployeeHoursRepository       = new TotalEmployeeHoursRepository(_databaseFactory);
            _holidayRepository                  = new HolidayRepository(_databaseFactory);
            _employeeDeductionRepository        = new EmployeeDeductionRepository(_databaseFactory);
            _deductionRepository                = new DeductionRepository(_databaseFactory);
            _employeePayrollItemRepository      = new EmployeePayrollItemRepository(_databaseFactory);
            _employeeAdjustmentRepository       = new EmployeeAdjustmentRepository(_databaseFactory);
            _adjustmentRepository               = new AdjustmentRepository(_databaseFactory);

            _employeeService             = new EmployeeService(_employeeRepository);
            _employeeInfoService         = new EmployeeInfoService(_employeeInfoRepository);
            _attendanceLogService        = new AttendanceLogService(_attendanceLogRepository);
            _attendanceService           = new AttendanceService(_unitOfWork, _attendanceRepository, _attendanceLogService, _employeeHoursRepository);
            _settingService              = new SettingService(_settingRepository);
            _employeeWorkScheduleService = new EmployeeWorkScheduleService(_employeeWorkScheduleRepository);
            _employeeSalaryService       = new EmployeeSalaryService();
            _employeeHoursService        = new EmployeeHoursService(_unitOfWork, _employeeHoursRepository,
                                                                    _attendanceService, _settingService, _employeeWorkScheduleService, _employeeInfoService);
            _totalEmployeeHoursService   = new TotalEmployeeHoursService(_unitOfWork, _totalEmployeeHoursRepository, _employeeHoursService, _settingService);
            _holidayService              = new HolidayService(_holidayRepository, _settingRepository, _unitOfWork);
            _employeeDailyPayrollService = new EmployeeDailyPayrollService(_unitOfWork, _totalEmployeeHoursService, _employeeWorkScheduleService, _holidayService,
                                                                           _settingService, _employeeDailyPayrollRepository, _employeeInfoService, _employeeSalaryService);
            _deductionService = new DeductionService(_deductionRepository);
            _taxService       = new TaxService(_taxRepository);
            _employeePayrollDeductionService = new EmployeePayrollDeductionService(_unitOfWork, _settingService, _employeeSalaryService, _employeeInfoService, _employeeDeductionService, _deductionService, _employeePayrollDeductionRepository, _taxService);
            _employeePayrollItemService      = new EmployeePayrollItemService(_unitOfWork, _employeePayrollItemRepository, _totalEmployeeHoursService, _employeeWorkScheduleService, _holidayService, _settingService, _employeeInfoService, _employeeSalaryService, _employeePayrollRepository, _employeePayrollDeductionRepository, _employeeAdjustmentRepository, _adjustmentRepository);
            _employeeAdjusmentService        = new EmployeeAdjustmentService(_employeeAdjustmentRepository, _employeeRepository);
            _employeePayrollService          = new EmployeePayrollService(_unitOfWork, _employeePayrollRepository, _settingService, null, _employeeInfoService, null, _employeeService, _totalEmployeeHoursService, _employeePayrollItemService, _employeeAdjusmentService);
        }
 public MaintenanceController(IUnitOfWork unitOfWork, ISettingRepository settingRepository, IPositionRepository positionRepository, IPaymentFrequencyRepository paymentFrequencyRepository,
                              IHolidayRepository holidayRepository, IDepartmentRepository departmentRepository, ILeaveRepository leaveRepository, ILoanRepository loanRepository,
                              IMachineRepository machineRepository, IWebService webService, IDeductionRepository deductionRepository,
                              IEmployeeMachineService emplyeeMachineService, IWorkScheduleRepository workScheduleRepository, IAdjustmentRepository adjustmentRepository,
                              ICompanyRepository companyRepository)
 {
     _unitOfWork                 = unitOfWork;
     _settingRepository          = settingRepository;
     _positionRepository         = positionRepository;
     _paymentFrequencyRepository = paymentFrequencyRepository;
     _departmentRepository       = departmentRepository;
     _holidayRepository          = holidayRepository;
     _leaveRepository            = leaveRepository;
     _loanRepository             = loanRepository;
     _machineRepository          = machineRepository;
     _webService                 = webService;
     _emplyeeMachineService      = emplyeeMachineService;
     _workScheduleRepository     = workScheduleRepository;
     _deductionRepository        = deductionRepository;
     _adjustmentRepository       = adjustmentRepository;
     _companyRepository          = companyRepository;
 }
Exemple #5
0
 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;
 }
 public DeductionGroupService(IDeductionRepository deductionRepository)
 {
     this.deductionRepository = deductionRepository;
 }
 public PersonnelController(IPersonnelRepository personnelRepository, IDeductionRepository deductionRepository)
 {
     _personnelRepository = personnelRepository;
     _deductionRepository = deductionRepository;
 }
 public DeductionService(IDeductionRepository deductionRepository)
 {
     _deductionRepository = deductionRepository;
 }
Exemple #9
0
        public UnitOfWork(IContoRepository contoRepository,
                          IBusinessPartnerBankAccountRepository businessPartnerBankAccountRepository,
                          IBusinessPartnerLocationRepository businessPartnerLocationRepository,
                          IBusinessPartnerPhoneRepository businessPartnerPhoneRepository,
                          IBusinessPartnerRepository businessPartnerRepository,

                          ICalculationsRepository inputCalculationsRepository,
                          IPriceLevelingRepository priceLevelingRepository,
                          IPricingRepository pricingRepository,

                          ICashierRepository cashierRepository,

                          IClawbackFromBuyerRepository clawbackFromBuyerRepository,
                          IClawbackFromSupplierRepository clawbackFromSupplierRepository,

                          ILoanRepository loanRepository,

                          IWritingOffRepository writingOffRepository,

                          ICompanyBankAccountRepository companyBankAccountRepository,
                          ICompanyPhoneRepository companyPhoneRepository,
                          ICompanyRepository companyRepository,

                          IDeliveryNoteRepository deliveryNoteRepository,
                          IInternalDeliveryNoteRepository internalDeliveryNoteRepository,
                          IInputNoteRepository inputNoteRepository,

                          IPassportRepository passportRepository,

                          IExchangeRateRepository exchangeRateRepository,

                          IAuthenticationRepository authenticationRepository,
                          IUserRepository userRepository,

                          IAccountStatementRepository accountStatementRepository,
                          IBookOfOutputInvoicesRepository bookOfOutputInvoicesRepository,
                          ICreditNoteRepository creditNoteRepository,
                          IOutputInvoiceRepository outputInvoiceRepository,
                          IInputInvoiceRepository inputInvoiceRepository,
                          IOutputProInvoiceRepository outputProInvoiceRepository,



                          ICountryRepository countryRepository,
                          ICityRepository cityRepository,
                          IExpenseLocationRepository expenseLocationRepository,

                          IMunicipalityRepository municipalityRepository,

                          IOrganizationUnitRepository organizationUnitRepository,
                          ISectionRepository sectionRepository,

                          IProductCardRepository productCardRepository,
                          IProductGroupRepository productGroupRepository,
                          IProductSubGroupRepository productSubGroupRepository,
                          IProductRepository productRepository,
                          IProductSubItemRepository productSubItemRepository,
                          IAnimalTypeRepository animalTypeRepository,
                          IAnimalSubTypeRepository animalSubTypeRepository,
                          IUnitOfMeasurementRepository unitOfMeasurementRepository,
                          IPalletRepository palletRepository,

                          IProductTypeRepository productTypeRepository,
                          IProductVatPercentRepository productVatPercentRepository,

                          IKepuBookRepository kepuBookRepository,

                          IBoxRepository boxRepository,
                          IDepotRepository depotRepository,
                          IStockRepository stockRepository,
                          IWarehouseRepository warehouseRepository,
                          IWarehouseTypeRepository warehouseTypeRepository,
                          IWarehousePriceTypeRepository warehousePriceTypeRepository,

                          IManuelWarrantRepository manuelWarrantRepository,
                          IEmployeeRepository employeeRepository,
                          IEmployeeBankAccountRepository employeeBankAccountRepository,
                          IWorkHourRepository workHourRepository,
                          IWorkTypeRepository workTypeRepository,
                          IDeductionTypeRepository deductionTypeRepository,
                          IContributionRepository contributionRepository,
                          IDeductionRepository deductionRepository,

                          IMonthUtilityRepository monthUtilityRepository,

                          IWarrantTypeRepository warrantTypeRepository,

                          IAmortizationGroupRepository amortizationGroupRepository,
                          IFixedAssetRepository fixedAssetRepository,

                          IMigrationLogRepository migrationLogRepository,

                          IFinancialTemplateRepository financialTemplateRepository,

                          IMainFinancialBookRepository mainFinancialBookRepository,

                          IAdvanceOutputInvoiceRepository advanceOutputInvoiceRepository)
        {
            this.context = ApplicationDbContext.GetInstance();

            this.contoRepository = contoRepository;

            this.businessPartnerBankAccountRepository = businessPartnerBankAccountRepository;
            this.businessPartnerLocationRepository    = businessPartnerLocationRepository;
            this.businessPartnerPhoneRepository       = businessPartnerPhoneRepository;
            this.businessPartnerRepository            = businessPartnerRepository;

            this.inputCalculationsRepository = inputCalculationsRepository;
            this.priceLevelingRepository     = priceLevelingRepository;
            this.pricingRepository           = pricingRepository;

            this.cashierRepository = cashierRepository;

            this.clawbackFromBuyerRepository    = clawbackFromBuyerRepository;
            this.clawbackFromSupplierRepository = clawbackFromSupplierRepository;

            this.loanRepository = loanRepository;

            this.writingOffRepository = writingOffRepository;

            this.companyBankAccountRepository = companyBankAccountRepository;
            this.companyPhoneRepository       = companyPhoneRepository;
            this.companyRepository            = companyRepository;

            this.deliveryNoteRepository         = deliveryNoteRepository;
            this.internalDeliveryNoteRepository = internalDeliveryNoteRepository;
            this.inputNoteRepository            = inputNoteRepository;

            this.passportRepository = passportRepository;

            this.exchangeRateRepository = exchangeRateRepository;

            this.authenticationRepository = authenticationRepository;
            this.userRepository           = userRepository;

            this.accountStatementRepository     = accountStatementRepository;
            this.bookOfOutputInvoicesRepository = bookOfOutputInvoicesRepository;
            this.creditNoteRepository           = creditNoteRepository;
            this.outputInvoiceRepository        = outputInvoiceRepository;
            this.outputProInvoiceRepository     = outputProInvoiceRepository;


            this.inputInvoiceRepository         = inputInvoiceRepository;
            this.advanceOutputInvoiceRepository = advanceOutputInvoiceRepository;

            this.countryRepository         = countryRepository;
            this.cityRepository            = cityRepository;
            this.expenseLocationRepository = expenseLocationRepository;

            this.municipalityRepository = municipalityRepository;

            this.organizationUnitRepository = organizationUnitRepository;
            this.sectionRepository          = sectionRepository;

            this.productCardRepository       = productCardRepository;
            this.productGroupRepository      = productGroupRepository;
            this.productSubGroupRepository   = productSubGroupRepository;
            this.productRepository           = productRepository;
            this.productSubItemRepository    = productSubItemRepository;
            this.animalTypeRepository        = animalTypeRepository;
            this.animalSubTypeRepository     = animalSubTypeRepository;
            this.unitOfMeasurementRepository = unitOfMeasurementRepository;
            this.palletRepository            = palletRepository;

            this.productTypeRepository       = productTypeRepository;
            this.productVatPercentRepository = productVatPercentRepository;

            this.kepuBookRepository = kepuBookRepository;

            this.boxRepository                = boxRepository;
            this.depotRepository              = depotRepository;
            this.stockRepository              = stockRepository;
            this.warehouseRepository          = warehouseRepository;
            this.warehouseTypeRepository      = warehouseTypeRepository;
            this.warehousePriceTypeRepository = warehousePriceTypeRepository;

            this.manuelWarrantRepository = manuelWarrantRepository;

            this.employeeRepository            = employeeRepository;
            this.employeeBankAccountRepository = employeeBankAccountRepository;
            this.deductionTypeRepository       = deductionTypeRepository;
            this.workHourRepository            = workHourRepository;
            this.workTypeRepository            = workTypeRepository;

            this.contributionRepository = contributionRepository;
            this.deductionRepository    = deductionRepository;

            this.monthUtilityRepository = monthUtilityRepository;

            this.warrantTypeRepository = warrantTypeRepository;

            this.amortizationGroupRepository = amortizationGroupRepository;
            this.fixedAssetRepository        = fixedAssetRepository;

            this.migrationLogRepository = migrationLogRepository;

            this.financialTemplateRepository = financialTemplateRepository;

            this.mainFinancialBookRepository = mainFinancialBookRepository;
        }