public IDictionary <Guid, PriceCalculatorResult> GetListPrices(PriceCalculatorArgs calculatorArgs, params PriceCalculatorItemArgs[] itemArgs)
        {
            var isAuthenticated = _securityContextService.GetIdentityUserSystemId().HasValue;

            if (!isAuthenticated)
            {
                return(_parent.GetListPrices(calculatorArgs, itemArgs));
            }

            return(itemArgs
                   .ToDictionary(
                       variantItem => variantItem.VariantSystemId,
                       variantItem => GetPriceFromErp(variantItem.VariantSystemId)
                       ));
        }
        public IDictionary <Guid, PriceCalculatorResult> GetListPrices(PriceCalculatorArgs calculatorArgs, params PriceCalculatorItemArgs[] itemArgs)
        {
            var isAuthenticated = _httpContextAccessor.HttpContext?.User.Identity?.IsAuthenticated ?? false;

            if (!isAuthenticated)
            {
                return(_parent.GetListPrices(calculatorArgs, itemArgs));
            }

            return(itemArgs
                   .ToDictionary(
                       variantItem => variantItem.VariantSystemId,
                       variantItem => GetPriceFromErp(variantItem.VariantSystemId)
                       ));
        }
        public IDictionary <Guid, PriceCalculatorResult> GetListPrices(PriceCalculatorArgs calculatorArgs, params PriceCalculatorItemArgs[] itemArgs)
        {
            if (SecurityToken.CurrentSecurityToken.IsAnonymousUser)
            {
                return(_parent.GetListPrices(calculatorArgs, itemArgs));
            }

            var result = new Dictionary <Guid, PriceCalculatorResult>();

            foreach (var variantItem in itemArgs)
            {
                result.Add(variantItem.VariantSystemId, GetPriceFromErp(variantItem.VariantSystemId));
            }

            return(result);
        }
示例#4
0
 public IDictionary <Guid, PriceCalculatorResult> GetListPrices([NotNull] PriceCalculatorArgs calculatorArgs, [NotNull] params PriceCalculatorItemArgs[] itemArgs)
 {
     SetOrangizationSystemIds(calculatorArgs);
     return(_parentResolver.GetListPrices(calculatorArgs, itemArgs));
 }