Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            using (ShoppingCartActions usersShoppingCart = new ShoppingCartActions())
            {
                decimal cartTotal, cartTotalQty = 0;

                cartTotal    = usersShoppingCart.GetTotal();
                cartTotalQty = usersShoppingCart.GetTotalQty();

                if (cartTotalQty > 0 || cartTotal > 0)
                {
                    // Display Total.
                    lblTotal.Text       = String.Format("{0:c}", cartTotal);
                    CheckoutBtn.Visible = true;
                    UpdateBtn.Visible   = true;
                }
                else
                {
                    LabelTotalText.Text         = "";
                    lblTotal.Text               = "";
                    ShoppingCartTitle.InnerText = "Shopping Cart is Empty";
                    CheckoutBtn.Visible         = false;
                    UpdateBtn.Visible           = false;
                }
            }
        }