예제 #1
0
        public static CartItemList GetCart()
        {
            CartItemList cart = (CartItemList)HttpContext.Current.Session["Cart"];

            if (cart == null)
            {
                HttpContext.Current.Session["Cart"] = new CartItemList();
            }
            return((CartItemList)HttpContext.Current.Session["Cart"]);
        }
예제 #2
0
 public void RemoveItem(CartItem cartItem)
 {
     CartItemList.Remove(cartItem);
     TotalCartCost -= cartItem.TotalItemCost;
     UpdateDiscountedTotalCost();
 }
예제 #3
0
 public void AddItem(CartItem cartItem)
 {
     CartItemList.Add(cartItem);
     TotalCartCost += cartItem.TotalItemCost;
     UpdateDiscountedTotalCost();
 }