示例#1
0
        private CBasketSet finalizeOutput(CBasketSet input, CBasket trackingBasket, CBasket used, CBasket free)
        {
            CBasketSet output = new CBasketSet();

            if ((used == null) && (free == null))
            {
                return(input);
            }

            //The original ones
            preserveOriginalGrouping(output, input);

            output.AddBasket(finalizeBasket(trackingBasket, BasketTypeEnum.Available));
            CBasket bundled = finalizeBasket(used, BasketTypeEnum.Bundled);

            output.AddBasket(bundled);

            int cnt = bundled.GetBasketItemCount();

            for (int i = 0; i < cnt; i++)
            {
                CBasketItem bi = bundled.GetBasketItem(i);
                bi.SetUnitPrice(0.00);
            }

            MPackage pkg = getPackage();

            bundled.SetAppliedPackage(getPackage());
            bundled.BundledAmount = triedCount * CUtil.StringToDouble(pkg.BundleAmount);

            return(output);
        }