Esempio n. 1
0
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            if (txtQuantity.Text != "")
            {
                // Response.Redirect("~/Cart.aspx");
            TP_Amazon_ClassLibrary.Cart cart = (TP_Amazon_ClassLibrary.Cart)Session["Cart"];
            TP_Amazon_ClassLibrary.Product product = new TP_Amazon_ClassLibrary.Product();
            product.ProductID = Session["sessionProdID"].ToString();
            product.Description = Session["sessionProdDesc"].ToString();
            product.Price = decimal.Parse(lblUnitPrice.Text.Substring(1));

            string prodMerchName = Session["sessionProdMerch"].ToString();
            if (prodMerchName == "One Stop Munchie Shop")
            {
                product.merchantName = "One Stop Munchie Shop";
            }
            else
            {
                product.merchantName = "Apocalypse Trading Co.";
            }

            product.URL = Session["sessionImgURL"].ToString();
            CartItem Item = new CartItem(product, int.Parse(txtQuantity.Text));
            cart.AddItem(Item);
            Session["Cart"] = cart;
                lblQOHError.Text = "";
            }
            else
            {
                lblQOHError.Text = "Select a Quantity!";
            }
        }
Esempio n. 2
0
 public void RemoveItem(CartItem Item)
 {
     cartItems.Remove(Item);
 }
Esempio n. 3
0
 public void AddItem(CartItem Item)
 {
     cartItems.Add(Item);
 }