예제 #1
0
        public static ShoppingCartInfo GetShoppingCart()
        {
            int               num;
            int               num2;
            string            str;
            string            str2;
            decimal           num3;
            DiscountValueType type;
            bool              flag;
            bool              flag2;
            bool              flag3;

            if (HiContext.Current.User.IsAnonymous)
            {
                return(CookieShoppingProvider.Instance().GetShoppingCart());
            }
            ShoppingProvider provider     = ShoppingProvider.Instance();
            ShoppingCartInfo shoppingCart = provider.GetShoppingCart(HiContext.Current.User.UserId);

            if ((shoppingCart.LineItems.Count == 0) && (shoppingCart.LineGifts.Count == 0))
            {
                return(null);
            }
            provider.GetPromotionsWithAmount(shoppingCart.GetAmount(), out num, out str, out num3, out type, out num2, out str2, out flag, out flag2, out flag3);
            if (!((num <= 0) || string.IsNullOrEmpty(str)))
            {
                shoppingCart.DiscountActivityId = num;
                shoppingCart.DiscountName       = str;
                shoppingCart.DiscountValue      = num3;
                shoppingCart.DiscountValueType  = type;
            }
            if (!((num2 <= 0) || string.IsNullOrEmpty(str2)))
            {
                shoppingCart.FeeFreeActivityId = num2;
                shoppingCart.FeeFreeName       = str2;
                shoppingCart.EightFree         = flag;
                shoppingCart.ProcedureFeeFree  = flag3;
                shoppingCart.OrderOptionFree   = flag2;
            }
            return(shoppingCart);
        }