Beispiel #1
0
        protected void SendButtonBuy(object sender, EventArgs e) //buy button
        {
            // int rowIndex = Convert.ToInt32(e.CommandArgument);
            count         = O.countOrders(); //calculate the id
            O.id          = Convert.ToInt32(count.Tables[0].Rows[0][0]);
            O.product     = int.Parse(GridView2.Rows[0].Cells[4].Text);
            O.productName = "Car Rental";
            O.price       = int.Parse(GridView2.Rows[0].Cells[5].Text);
            O.userN       = Session["Login"].ToString();
            O.adults      = 1;
            O.children    = 0;
            O.buy         = 0;
            O.totalPrice  = int.Parse(GridView2.Rows[0].Cells[5].Text); //calculta the price
            d             = O.add_Order();                              //add to the shopping cart

            Response.Redirect("Order.aspx");                            // redirect
        }
        protected void SendButtonBuy(object sender, EventArgs e) //send button
        {
            int adults   = int.Parse(Adults.Text);
            int children = int.Parse(Children.Text);
            int price    = int.Parse(GridView2.Rows[0].Cells[5].Text);

            count = O.countOrders(); //calculte the id

            O.id          = Convert.ToInt32(count.Tables[0].Rows[0][0]);
            O.product     = int.Parse(GridView2.Rows[0].Cells[4].Text);
            O.productName = "Cruise";
            O.price       = price;
            O.userN       = Session["Login"].ToString();
            O.adults      = adults;
            O.children    = children;
            O.buy         = 0;
            O.totalPrice  = price * adults + price * children * 80 / 100; //calculate the price
            d             = O.add_Order();                                //add to the shopping cart

            Response.Redirect("Order.aspx");
        }