コード例 #1
0
        private void SetLabelText(int productId)
        {
            Product p = ProductHandler.GetProduct(productId);
            Cart    c = CartHandler.GetCart(Int32.Parse(Session["id"].ToString()), productId);

            prodName.Text    = p.Name;
            prodPrice.Text   = p.Price.ToString();
            prodStock.Text   = p.Stock.ToString();
            quantityTxt.Text = c.Quantity.ToString();
        }
コード例 #2
0
        private Cart GetCart()
        {
            var member = PublicUser.GetCurrentUser();

            if (member != null && member.MemberId > 0)
            {
                return(CartHandler.GetCart(member.MemberId));
            }
            var cart = (Cart)Session[Constants.CartKeyName];

            if (cart == null)
            {
                cart = new Cart();
                Session[Constants.CartKeyName] = cart;
            }
            return(cart);
        }
コード例 #3
0
 public static Cart GetCart(int ProductID, int UserID)
 {
     return(CartHandler.GetCart(ProductID, UserID));
 }