Exemplo n.º 1
0
        private void xóaMáyBayToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form4 f = new Form4();

            f.setLabel1("Mã máy bay cần xóa");
            while (f.ShowDialog() == DialogResult.OK)
            {
                if (f.getTB1() == "")
                {
                    MessageBox.Show("Chưa điền đủ thông tin", "Title", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    continue;
                }
                string a = f.getTB1();
                if (check_plane_exist(obj, a) == false)
                {
                    MessageBox.Show("Mã máy bay này không tồn tại", "Title", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    f.Close();
                    break;
                }
                deleteairplane(obj, a);
                MessageBox.Show("Xóa máy bay thành công", "Title", MessageBoxButtons.OK, MessageBoxIcon.Information);
                f.Close();
                break;
            }
        }
Exemplo n.º 2
0
        private void Form4_FormClosed(object sender, FormClosedEventArgs e)
        {
            this.Hide();
            Form4 f = new Form4();

            f.Close();
        }
Exemplo n.º 3
0
        private void thốngKêDanhSáchVéTrốngToolStripMenuItem_Click(object sender, EventArgs e)
        {
            bool  tf = true;
            Form4 f  = new Form4();

            f.setLabel1("Mã chuyến bay ");
            f.setButton("Thống kê");
            string Mystring = "";

            while (f.ShowDialog() == DialogResult.OK)
            {
                if (f.getTB1() == "")
                {
                    MessageBox.Show("Chưa điền đủ thông tin", "Title", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    continue;
                }
                Mystring = f.getTB1();
                if (check_flight_exist(obj, Mystring) == false)
                {
                    MessageBox.Show("Mã chuyến bay không tồn tại", "Title", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    tf = false;
                    f.Close();
                    break;
                }
                f.Close();
                break;
            }
            if (tf == false)
            {
                return;
            }
            string str = "";

            availticket_info(obj, Mystring);
            using (StreamReader sr = File.OpenText("output3.txt"))
            {
                str = sr.ReadLine();
            }
            if (str == "not")
            {
                MessageBox.Show("Không còn vé trống", "Title", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            Form11 ff = new Form11(Mystring, str);

            ff.Show();
        }
Exemplo n.º 4
0
        private void dToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form4 f = new Form4();

            while (f.ShowDialog() == DialogResult.OK)
            {
                if (f.getTB1() == "")
                {
                    MessageBox.Show("Chưa điền đủ thông tin", "Title", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    continue;
                }
                string a = f.getTB1();
                if (check_flight_exist(obj, a) == false)
                {
                    MessageBox.Show("Mã chuyến bay này không tồn tại", "Title", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    f.Close();
                    break;
                }
                Denyflight(obj, a);
                MessageBox.Show("Hủy chuyến bay thành công", "Title", MessageBoxButtons.OK, MessageBoxIcon.Information);
                f.Close();
                break;
            }
        }