コード例 #1
0
 public CalculatorController(IFeeRepository feeFeeRepository, IPricingRepository pricingRepository, ILoyaltyRepository loyaltyRepository, IEquipmentService equipmentService)
 {
     _feeRepository     = feeFeeRepository;
     _pricingRepository = pricingRepository;
     _loyaltyRepository = loyaltyRepository;
     _equipmentService  = equipmentService;
 }
コード例 #2
0
 public PricingService(IPricingRepository pricingRepository, IHttpClientFactory clientFactory,
                       IConfiguration configuration)
 {
     _pricingRepository = pricingRepository;
     _clientFactory     = clientFactory;
     _configuration     = configuration;
 }
コード例 #3
0
        public void LoadDiscounts(string productSku)
        {
            try
            {
                if (string.IsNullOrEmpty(productSku))
                {
                    this.viewExceptionHandler.ShowFunctionalErrorMessage(TheProductSKUWasNotDefined, this.ErrorVisualizer);
                    return;
                }

                IPricingRepository     pricingRepository = SharePointServiceLocator.Current.GetInstance <IPricingRepository>();
                IEnumerable <Discount> discounts         = pricingRepository.GetDiscountsBySku(productSku);

                if (!discounts.Any())
                {
                    ShowSkuNotFoundError(productSku);
                    return;
                }

                this.discountsView.Discounts = discounts;
                this.discountsView.DataBind();
            }
            catch (Exception exception)
            {
                // An unhandled exception has occurred. Make sure the exception is logged and
                // a technical error message is displayed to the user. Because no message is specified here
                // the default message is used.
                viewExceptionHandler.HandleViewException(exception, this.ErrorVisualizer);
            }
        }
コード例 #4
0
 private static void InstanciateDependancies()
 {
     #region Preparing for dependancy injection
     storage           = InMemoryStorage.Instance;
     articleRepository = new ArticleRepository(storage);
     pricingRepository = new PricingRepository(storage);
     orderRepository   = new OrderRepository(storage);
     logger            = new Core.ConsoleLogger <ShopService>();
     #endregion
     articleService = new ArticleService(articleRepository, new Core.ConsoleLogger <ArticleService>());
     shopService    = new ShopService(articleRepository, pricingRepository, orderRepository, logger);
 }
コード例 #5
0
 public ShopService(
     IArticleRepository articleRepository,
     IPricingRepository pricingRepository,
     IOrderRepository orderRepository,
     ILogger <ShopService> logger
     )
 {
     this._logger            = logger;
     this._articleRepository = articleRepository;
     this._pricingRepository = pricingRepository;
     this._orderRepository   = orderRepository;
 }
コード例 #6
0
        private void TryToCreateCatalogAssignment(dataModel.Price price, IPricingRepository repository)
        {
            //need create price list assignment to catalog if it not exist
            var product = _productService.GetById(price.ProductId, Domain.Catalog.Model.ItemResponseGroup.ItemInfo);

            if (!repository.PricelistAssignments.Where(x => x.PricelistId == price.PricelistId && x.CatalogId == product.CatalogId).Any())
            {
                var assignment = new coreModel.PricelistAssignment
                {
                    CatalogId   = product.CatalogId,
                    Name        = product.Catalog.Name + "-" + price.Pricelist.Name,
                    PricelistId = price.Pricelist.Id
                };
                CreatePriceListAssignment(assignment);
            }
        }
コード例 #7
0
        protected virtual IQueryable <PricelistEntity> BuildQuery(IPricingRepository repository, PricelistSearchCriteria criteria)
        {
            var query = repository.Pricelists;

            if (!string.IsNullOrEmpty(criteria.Keyword))
            {
                query = query.Where(x => x.Name.Contains(criteria.Keyword) || x.Description.Contains(criteria.Keyword));
            }

            if (!criteria.Currencies.IsNullOrEmpty())
            {
                query = query.Where(x => criteria.Currencies.Contains(x.Currency));
            }

            return(query);
        }
コード例 #8
0
        protected virtual IQueryable <PriceEntity> GetPricesQuery(IPricingRepository repository, PricesSearchCriteria criteria, out ICollection <CatalogProduct> products)
        {
            products = new List <CatalogProduct>();

            var query = repository.Prices;

            if (!criteria.PriceListIds.IsNullOrEmpty())
            {
                query = query.Where(x => criteria.PriceListIds.Contains(x.PricelistId));
            }

            if (!criteria.ProductIds.IsNullOrEmpty())
            {
                query = query.Where(x => criteria.ProductIds.Contains(x.ProductId));
            }

            if (!string.IsNullOrEmpty(criteria.Keyword))
            {
                var catalogSearchCriteria = new SearchCriteria
                {
                    Keyword       = criteria.Keyword,
                    Skip          = criteria.Skip,
                    Take          = criteria.Take,
                    Sort          = criteria.Sort.Replace("product.", string.Empty),
                    ResponseGroup = SearchResponseGroup.WithProducts,
                };
                var catalogSearchResult = _catalogSearchService.Search(catalogSearchCriteria);

                var productIds = catalogSearchResult.Products.Select(x => x.Id).ToArray();
                //preserve resulting products for future assignment to prices
                products = catalogSearchResult.Products;

                query = query.Where(x => productIds.Contains(x.ProductId));
            }

            if (criteria.ModifiedSince.HasValue)
            {
                query = query.Where(x => x.ModifiedDate >= criteria.ModifiedSince);
            }

            return(query);
        }
コード例 #9
0
        public PricingModuleViewModel(IPricingRepository pricingRepo, Session <NullT> session, string name)
        {
            Name = name;

            //EventManager.GetEvent<SaveEvent>()
            //    .Subscribe(evt =>
            //    {
            //        Domain.PriceRoutine pricingToSave = null;
            //        //ViewModelBase vm = null;
            //        switch (evt.Section)
            //        {
            //            case Domain.SectionType.PlanningPricingIdentity:
            //                var vmi = (ViewModels.Pricing.IdentityViewModel)(SelectedStepViewModel);
            //                var tagsToSave = vmi.SelectedTags;
            //                pricingToSave = vmi.SelectedPriceRoutine;
            //                vmi.SelectedPriceRoutine.Tags = tagsToSave.Select(y => y.Value).ToList<string>();
            //                pricingRepo.Save<Domain.PriceRoutine>(pricingToSave);
            //                this.Navigate(new NavigateEvent
            //                {
            //                    Module = Domain.ModuleType.Planning,
            //                    SubModule = Domain.SubModuleType.Everyday,
            //                    Section = Domain.SectionType.PlanningPricingFilters
            //                }); //TODO: switch by pricingtype evryday, promo, kits
            //                break;
            //            case Domain.SectionType.PlanningAnalyticsFilters:
            //                var vmf = (ViewModels.Pricing.FilterViewModel)(SelectedStepViewModel);
            //                pricingToSave = vmf.SelectedPriceRoutine;
            //                pricingRepo.Save<Domain.PriceRoutine>(pricingToSave);
            //                this.Navigate(new NavigateEvent
            //                {
            //                    Module = Domain.ModuleType.Planning,
            //                    SubModule = Domain.SubModuleType.Everyday,
            //                    Section = Domain.SectionType.PlanningPricingPriceLists
            //                });
            //                break;
            //            default:
            //                break;
            //        }
            //    });
        }
コード例 #10
0
        public void ShowPricing(string productSku)
        {
            try
            {
                if (!string.IsNullOrEmpty(productSku))
                {
                    IPricingRepository pricingRepository = SharePointServiceLocator.Current.GetInstance <IPricingRepository>();
                    Price price = pricingRepository.GetPriceBySku(productSku);

                    if (price == null)
                    {
                        this.PriceText = "There is no price available for this product.";
                    }
                    else
                    {
                        this.PriceText = price.Value.ToString("C", CultureInfo.CurrentUICulture);
                    }
                }
                else
                {
                    PriceText = "The product has not been specified.";
                }
                this.DataBind();
            }
            catch (Exception ex)
            {
                // If an unknown exception occurs we want to:
                // 1. Log the error
                // 2. Display a friendly (Non technical) error message.
                // The ViewExceptionHandler will do that for us:
                ViewExceptionHandler viewExceptionHandler = new ViewExceptionHandler();

                // In this example, we are looking for an error visualizer up in the tree and using that to display the error.
                // Find the error Visualizer (in this case, the one that was added by the PricingWebPart.cs:
                IErrorVisualizer errorVisualizer = ViewExceptionHandler.FindErrorVisualizer(this);

                // Now log the error and display a friendly error message using the error visualizer.
                viewExceptionHandler.HandleViewException(ex, errorVisualizer, string.Format(CultureInfo.CurrentUICulture, "Due to a technical problem, the pricing information for sku '{0}' could not be retrieved. Please try again later.", productSku));
            }
        }
コード例 #11
0
        protected virtual async Task <IQueryable <PriceEntity> > BuildQueryAsync(IPricingRepository repository, PricesSearchCriteria criteria)
        {
            var query = repository.Prices;

            if (!criteria.PriceListIds.IsNullOrEmpty())
            {
                query = query.Where(x => criteria.PriceListIds.Contains(x.PricelistId));
            }

            if (!criteria.ProductIds.IsNullOrEmpty())
            {
                query = query.Where(x => criteria.ProductIds.Contains(x.ProductId));
            }

            if (criteria.ModifiedSince.HasValue)
            {
                query = query.Where(x => x.ModifiedDate >= criteria.ModifiedSince);
            }

            if (!string.IsNullOrEmpty(criteria.Keyword))
            {
                var searchCriteria = AbstractTypeFactory <ProductIndexedSearchCriteria> .TryCreateInstance();

                searchCriteria.Keyword       = criteria.Keyword;
                searchCriteria.Skip          = criteria.Skip;
                searchCriteria.Take          = criteria.Take;
                searchCriteria.Sort          = criteria.Sort.Replace("product.", string.Empty);
                searchCriteria.ResponseGroup = ItemResponseGroup.ItemInfo.ToString();
                var searchResult = await _productIndexedSearchService.SearchAsync(searchCriteria);

                var productIds = searchResult.Items.Select(x => x.Id).ToArray();

                query = query.Where(x => productIds.Contains(x.ProductId));
            }

            return(query);
        }
コード例 #12
0
		private void TryToCreateCatalogAssignment(dataModel.Price price, IPricingRepository repository)
		{
			//need create price list assignment to catalog if it not exist
			var product = _productService.GetById(price.ProductId, Domain.Catalog.Model.ItemResponseGroup.ItemInfo);
			if (!repository.PricelistAssignments.Where(x => x.PricelistId == price.PricelistId && x.CatalogId == product.CatalogId).Any())
			{
				var assignment = new coreModel.PricelistAssignment
				{
					CatalogId = product.CatalogId,
					Name = product.Catalog.Name + "-" + price.Pricelist.Name,
					PricelistId = price.Pricelist.Id
				};
				CreatePriceListAssignment(assignment);
			}
		}
コード例 #13
0
ファイル: PricingService.cs プロジェクト: dkil1972/checkout
 public PricingService(IPricingRepository repository)
 {
     Repository = repository;
 }
コード例 #14
0
 public PricingService(IPricingRepository pricingRepository)
 {
     _pricingRepository = pricingRepository;
 }
コード例 #15
0
 public void Initialize()
 {
     _connMultiplexer   = new Mock <IConnectionMultiplexer>();
     _fixture           = new Fixture();
     _pricingRepository = new PricingRepository(_connMultiplexer.Object);
 }
コード例 #16
0
 private PricingServiceImpl GetPricingServiceImpl(IPlatformMemoryCache platformMemoryCache, IPricingRepository pricingRepository)
 {
     return(new PricingServiceImpl(
                () => pricingRepository,
                _productServiceMock.Object,
                _loggerMock.Object,
                platformMemoryCache,
                _eventPublisherMock.Object,
                _pricingPriorityFilterPolicyMock.Object
                ));
 }
コード例 #17
0
 public PricingEventHandler(IPricingRepository repository)
 {
     _repository = repository;
 }
コード例 #18
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;
        }
コード例 #19
0
 public PriceEngine(IPricingRepository pricingRepo)
 {
     _pricingRepo = pricingRepo;
 }
コード例 #20
0
 public RetailProductManager(IRetailProductRepository retailProductRepository, IPricingRepository pricingRepository)
 {
     _retailProductRepository = retailProductRepository;
     _pricingRepository       = pricingRepository;
 }
コード例 #21
0
 public PriceEngine(IPricingRepository pricingRepo, ILog logger)
 {
     _pricingRepo = pricingRepo;
     _logger      = logger;
 }
コード例 #22
0
 public PricingController(IPricingRepository pricingRepository)
 {
     _pricingRepository = pricingRepository;
 }
コード例 #23
0
ファイル: PricingService.cs プロジェクト: jorupp/eveTools
 public PricingService(IPricingRepository pricingRepository, DataCore dataCore)
 {
     _dataCore = dataCore;
     _data = new Lazy<IDictionary<int, ItemPricingStats>>(() => pricingRepository.GetStats(dataCore.JitaId(), null).ToDictionary(i => i.typeId));
 }
コード例 #24
0
        protected virtual IQueryable <PricelistAssignmentEntity> GetPricelistAssignmentsQuery(IPricingRepository repository, PricelistAssignmentsSearchCriteria criteria)
        {
            var query = repository.PricelistAssignments;

            if (!criteria.PriceListIds.IsNullOrEmpty())
            {
                query = query.Where(x => criteria.PriceListIds.Contains(x.PricelistId));
            }

            if (!string.IsNullOrEmpty(criteria.Keyword))
            {
                query = query.Where(x => x.Name.Contains(criteria.Keyword) || x.Description.Contains(criteria.Keyword));
            }

            if (!criteria.CatalogIds.IsNullOrEmpty())
            {
                query = query.Where(x => criteria.CatalogIds.Contains(x.CatalogId));
            }

            return(query);
        }
コード例 #25
0
 public PricingManager()
 {
     _AlphasoftWebsiteContext = new AlphasoftWebsiteContext();
     _iPricingRepository      = new PricingRepository(_AlphasoftWebsiteContext);
 }
コード例 #26
0
 public PricingService(IPricingRepository pricingRepository)
 {
     this.pricingRepository = pricingRepository ?? throw new System.ArgumentNullException(nameof(pricingRepository));
 }
コード例 #27
0
 public PricingController(ICommandSender commandSender, IPricingRepository repository)
 {
     _commandSender = commandSender;
     _repository    = repository;
 }