Ejemplo n.º 1
0
        protected void ButtonNext_Click(object sender, EventArgs e)
        {
            updatePrice();
            string toppings = "";

            for (int i = 0; i < CheckBoxListToppings.Items.Count; i++)
            {
                if (CheckBoxListToppings.Items[i].Selected)
                {
                    toppings += CheckBoxListToppings.Items[i].Text + ", ";
                }
            }//close for loop
            ShoppingCartUti cart = new ShoppingCartUti();

            //The below line needs to be changed later on.
            cart.UserName   = Session["user"].ToString();
            cart.PizzaSize  = DropDownListPizzaSize.SelectedItem.ToString();
            cart.PizzaStyle = DropDownListPizzaStyle.SelectedItem.ToString();
            cart.Toppings   = toppings;
            cart.Price      = (double)price * (1.07);
            cart.insertShoppingCart();
            //The below line (Response) needs to be removed by
            //Response.Redirect("OrderConfirm.aspx?=id"+cart.ID);
            // Response.Write("<script language=javascript> var agree;agree=confirm('You have successfully added into ShoppingCart table'); </script>");

            Response.Redirect("OrderConfirm.aspx?id=" + cart.ID);
        }
Ejemplo n.º 2
0
    protected void ButtonNext_Click(object sender, EventArgs e)
    {
        updatePrice();
        string toppings = "";

        for (int i = 0; i < CheckBoxListToppings.Items.Count; i++)
        {
            if (CheckBoxListToppings.Items[i].Selected)
            {
                toppings += CheckBoxListToppings.Items[i].Text + ", ";
            }
        }//close for
        ShoppingCartUti cart = new ShoppingCartUti();

        cart.PizzaSize  = DropDownListPizzaSize.SelectedItem.ToString();
        cart.PizzaStyle = DropDownListPizzaStyle.SelectedItem.ToString();
        cart.Price      = (double)price * (1.07);
        cart.Toppings   = toppings;
        cart.UserName   = Session["user"].ToString();
        cart.insertShoppingCart();
        Response.Redirect("OrderConfirm.aspx?id=" + cart.ID);
    }