Exemplo n.º 1
0
        public void DisplayCart()
        {
            lstCart.Items.Clear();

            for (int i = 0; i < itemList.Count(); i++)
            {
                Cartitem itemToDisplay = itemList.itemAt(i);
                lstCart.Items.Add(itemToDisplay.Display());
            }
        }
Exemplo n.º 2
0
        //private Cartitem itempass;

        protected void Page_Load(object sender, EventArgs e)
        {
            //how can I receive information from btnAdd_Click from order page
            //Page lastPage = (Page)Context.Handler;


            myCartItem = (Cartitem)Session["Cartitem"];
            //Validate that there are items within the cart
            if (myCartItem != null)
            {
                //write out what is being purchased
                lstCart.Items.Add(myCartItem.Display());
                string itemString = "Purchasing" + myCartItem.Quantity.ToString() + "" + myCartItem.Product.Name;
                lstCart.Items.Add(itemString);
            }
            else
            {
                lstCart.Items.Add("Please add an item into the cart.");
            }
        }