Beispiel #1
0
            private static void InitializePriceContexOfAlgorithmMode(PriceContext priceContext, IPricingDataAccessor pricingDataManager)
            {
                ChannelPriceConfiguration channelPriceConfig = pricingDataManager.GetChannelPriceConfiguration();

                priceContext.DiscountAlgorithmMode         = channelPriceConfig.DiscountAlgorithmMode;
                priceContext.MaxBestDealAlgorithmStepCount = channelPriceConfig.MaxBestDealStepCount;
            }
            /// <summary>
            /// Gets the channel price configuration.
            /// </summary>
            /// <returns>Channel price configuration.</returns>
            public ChannelPriceConfiguration GetChannelPriceConfiguration()
            {
                using (SimpleProfiler profiler = new SimpleProfiler("GetChannelPriceConfiguration", 1))
                {
                    ChannelPriceConfiguration channelPriceConfiguration = null;

                    var response = this.ExecuteDataService <ChannelPriceConfiguration>(new EntityDataServiceRequest <ChannelPriceConfiguration>(QueryResultSettings.FirstRecord));

                    channelPriceConfiguration = response.SingleOrDefault();

                    if (channelPriceConfiguration == null)
                    {
                        channelPriceConfiguration = new ChannelPriceConfiguration()
                        {
                            Company           = this.requestContext.GetChannelConfiguration().InventLocationDataAreaId,
                            CompanyCurrency   = this.requestContext.GetChannelConfiguration().CompanyCurrency,
                            ChannelTimeZoneId = this.requestContext.GetChannelConfiguration().TimeZoneInfoId,
                        };
                    }

                    return(channelPriceConfiguration);
                }
            }