Exemple #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            FormMenu formMenu = new FormMenu();

            this.Hide();
            formMenu.ShowDialog();
        }
        private void button2_Click(object sender, EventArgs e)
        {
            try
            {
                orderTour            = new OrderTour();
                orderTour.KH_Order   = new KhachHang();
                orderTour.Tour_Order = new Tour();
                orderTour.SoKH       = Convert.ToInt32(textBox2.Text);
                orderTour.SoNguoiLon = Convert.ToInt32(textBox3.Text);
                orderTour.SoTreEm    = Convert.ToInt32(textBox4.Text);
                string id = comboBox1.Text;

                if (orderTour.SoKH == orderTour.SoNguoiLon + orderTour.SoTreEm)
                {
                    if (orderTourBL.Create_Order(textBox1.Text, id, orderTour) == true)
                    {
                        MessageBox.Show("Tạo Thành Công");
                        var get_tour = tourBL.GetAllTour();
                        dataGridView1.DataSource = get_tour;
                        FormMenu formMenu = new FormMenu();
                        this.Hide();
                        formMenu.ShowDialog();
                    }
                    else
                    {
                        MessageBox.Show("Tạo Không Thành Công");
                    }
                }
                else
                {
                    MessageBox.Show("Số Khách Hàng Không Hợp Lệ");
                }
            }
            catch (System.Exception)
            {
            }
        }