コード例 #1
0
 public JobUnitAppService(JobUnitManager jobUnitManager, IRepository <JobUnit> jobUnitRepository, IRepository <JobCommercialUnit> jobDetailUnitRepository,
                          IRepository <EmployeeUnit> employeeUnitRepository, IRepository <CustomerUnit> customerUnitRepository, IJobCommercialAppService jobCommercialAppService,
                          IRepository <OrganizationUnit, long> organizationUnitRepository, IRepository <JobAccountUnit, long> jobAccountUnitRepository,
                          IRepository <CoaUnit> coaUnitRepository, IRepository <AccountUnit, long> accountUnitRepository, IRepository <ValueAddedTaxRecoveryUnit> valueAddedTaxRecoveryUnitRepository,
                          IRepository <ValueAddedTaxTypeUnit> valueAddedTaxTypeUnitRepository, IRepository <TypeOfCountryUnit, short> typeOfCountryUnitRepository,
                          IRepository <CountryUnit> countryUnitRepository, IJobAccountUnitAppService jobAccountUnitAppService, IRepository <TaxCreditUnit> taxCreditUnitRepository,
                          ICacheManager cacheManager, CustomAppSession customAppSession, IUnitOfWorkManager unitOfWorkManager, IRepository <JobLocationUnit> jobLocationRepository,
                          DivisionCache divisioncache, AccountCache accountcache, CustomerCache customercache,
                          ICustomJobAccountRepository jobAccountRepository)
 {
     _jobUnitManager                      = jobUnitManager;
     _jobUnitRepository                   = jobUnitRepository;
     _jobDetailUnitRepository             = jobDetailUnitRepository;
     _employeeUnitRepository              = employeeUnitRepository;
     _customerUnitRepository              = customerUnitRepository;
     _jobCommercialAppService             = jobCommercialAppService;
     _organizationUnitRepository          = organizationUnitRepository;
     _coaUnitRepository                   = coaUnitRepository;
     _accountUnitRepository               = accountUnitRepository;
     _jobAccountUnitRepository            = jobAccountUnitRepository;
     _valueAddedTaxRecoveryUnitRepository = valueAddedTaxRecoveryUnitRepository;
     _valueAddedTaxTypeUnitRepository     = valueAddedTaxTypeUnitRepository;
     _typeOfCountryUnitRepository         = typeOfCountryUnitRepository;
     _countryUnitRepository               = countryUnitRepository;
     _jobAccountUnitAppService            = jobAccountUnitAppService;
     _taxCreditUnitRepository             = taxCreditUnitRepository;
     _cacheManager          = cacheManager;
     _customAppSession      = customAppSession;
     _unitOfWorkManager     = unitOfWorkManager;
     _jobLocationRepository = jobLocationRepository;
     _divisioncache         = divisioncache;
     _accountcache          = accountcache;
     _customercache         = customercache;
     _jobAccountRepository  = jobAccountRepository;
 }
コード例 #2
0
 public DivisionUnitAppService(JobUnitManager jobUnitManager, IRepository <JobUnit> jobUnitRepository,
                               IRepository <CoaUnit> coaUnitRepository,
                               IRepository <TypeOfCurrencyUnit, short> typeOfCurrencyUnitRepository, DivisionCache divisioncache,
                               ICustomDivisionRepository customDivisionRepository, ICacheManager cacheManager)
 {
     _jobUnitManager               = jobUnitManager;
     _jobUnitRepository            = jobUnitRepository;
     _coaUnitRepository            = coaUnitRepository;
     _typeOfCurrencyUnitRepository = typeOfCurrencyUnitRepository;
     _divisioncache            = divisioncache;
     _customDivisionRepository = customDivisionRepository;
     _cacheManager             = cacheManager;
 }
コード例 #3
0
        /// <summary>
        /// Gets the division id value
        /// </summary>
        /// <param name="from">The from value to parse</param>
        /// <param name="user">The user object that contains the data.</param>
        /// <returns></returns>
        public EntityId GetDivisionFieldValue(string from, ActiveDirectoryUser user)
        {
            // get the division name value
            var divisionName = GetFieldValue(from, user);

            // check the cache
            if (DivisionCache.ContainsKey(divisionName))
            {
                return(new EntityId(DivisionCache.GetValue(divisionName)));
            }

            // division does not exist in the cache...get it from the service
            var divisionId = ApiService.GetDivisionAsync(divisionName, AuthToken).GetAwaiter().GetResult();

            if (divisionId != null)
            {
                DivisionCache.Add(divisionName, divisionId);
                return(new EntityId(divisionId));
            }

            return(null);
        }