Пример #1
0
 protected void btnContinue_Click(object sender, EventArgs e)
 {
     if (txtname.Text == "" || txtemail.Text == "" || txtphone.Text == "" || txtaddress.Text == "" || txtquantity.Text == "")
     {
         Response.Write("<script>alert('Thông tin không được bỏ trống')</script>");
     }
     else
     {
         if (txtid.Text == "" || txtprice.Text == "")
         {
             Response.Write("<script>alert('Mời nhấn nút mua tour để thêm thông tin chi tiết')</script>");
         }
         else
         {
             dt.Name        = txtname.Text;
             dt.Email       = txtemail.Text;
             dt.Phone       = txtphone.Text;
             dt.Address     = txtaddress.Text;
             order.TourID   = int.Parse(txtid.Text);
             order.Quantity = int.Parse(txtquantity.Text);
             int num1 = int.Parse(txtquantity.Text);
             int num2 = int.Parse(txtprice.Text);
             int tong = num1 * num2;
             txttongtien.Text = tong.ToString();
             order.Subtotal   = int.Parse(txttongtien.Text);
             or.ThemOrder(dt.Name, dt.Email, dt.Phone, dt.Address, order.TourID, order.Quantity, order.Subtotal);
             Response.Write("<script>alert('Đăng ký thành công')</script>");
             Response.Redirect("detailbooktour.aspx");
         }
     }
 }