示例#1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            MoviesWebSite.BLL.MyShoppingCart userShoppingCart =
                new MoviesWebSite.BLL.MyShoppingCart();

            string cartId =
                userShoppingCart.GetShoppingCartSession();
            decimal cartTotal = 0;

            cartTotal = userShoppingCart.GetTotal(cartId);
            if (cartTotal > 0)
            {
                lblTotal.Text = string.Format("{0:c}",
                                              userShoppingCart.GetTotal(cartId));
            }
            else
            {
                lblTotalOrder.Text          = "";
                lblTotal.Text               = "";
                shoppingCartTitle.InnerText =
                    "Shopping Cart is Empty";
                btnUpdate.Visible   = false;
                btnChcekout.Visible = false;
            }
        }
示例#2
0
        protected void btnChceckout_Click
            (object sender, ImageClickEventArgs e)
        {
            MoviesWebSite.BLL.MyShoppingCart userShoppingCart =
                new MoviesWebSite.BLL.MyShoppingCart();

            if (userShoppingCart.SubmitOrder
                    (User.Identity.Name) == true)
            {
                CheckoutHeader.InnerText = "Thank You";
                Message.Visible          = false;
                btnChceckout.Visible     = false;
            }
            else
            {
                CheckoutHeader.InnerText = "Order faild try again";
            }
        }
示例#3
0
        protected void LoginUser_LoggedIn
            (object sender, EventArgs e)
        {
            MoviesWebSite.BLL.MyShoppingCart userShoppingCart =
                new MoviesWebSite.BLL.MyShoppingCart();
            string cartId = userShoppingCart.GetShoppingCartSession();

            userShoppingCart.MigrateCart(cartId, LoginUser.UserName);

            // Take the current session and refresh
            // the session with new info
            if (Session["TempLoginReference"] != null)
            {
                Response.Redirect
                    (Session["TempLoginReference"].ToString());
            }
            Session["UserName"] = LoginUser.UserName;
        }