protected void Page_Load(object sender, EventArgs e)
    {
        DisplayCart();
        lblDeliveryFee.Text = "2";
        double tax        = 0.07;
        double fullAmount = 1.07;

        lblTax.Text   = System.Math.Round(((cart.GetCartTotal() + 2) * (decimal)tax), 2).ToString();
        lblTotal.Text = System.Math.Round(((cart.GetCartTotal() + 2) * (decimal)fullAmount), 2).ToString();

        //else Response.Redirect("/Order");
    }
예제 #2
0
    private void DisplayCart()
    {
        cart = CartItemList.GetCart();
        lstCart.Items.Clear();
        CartItem item;

        for (int i = 0; i < cart.Count; i++)
        {
            item = cart[i];
            lstCart.Items.Add(item.Display());
            lblTotal.Text = "Total = " + String.Format("{0:C2}", cart.GetCartTotal());
        }

        if (lstCart.Items.Count <= 0)
        {
            lstCart.Items.Add("Empty Cart");
        }
    }