예제 #1
0
        private void addFlightToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form3 f = new Form3();

            while (f.ShowDialog() == DialogResult.OK)
            {
                if (f.getTB1() == "" || f.getTB2() == "" || f.getTB3() == "" || f.getTB4() == "")
                {
                    MessageBox.Show("Chưa điền đủ thông tin", "Title", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    continue;
                }
                string a = f.getTB1();
                string b = f.getTB2();
                string c = f.getTB3();
                string d = f.getTB4();
                if (check_flight_exist(obj, a) == true)
                {
                    MessageBox.Show("Mã chuyến bay này đã tồn tại", "Title", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    continue;
                }
                if (check_plane_exist(obj, d) == false)
                {
                    MessageBox.Show("Mã máy bay này không tồn tại", "Title", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    continue;
                }
                addflight(obj, a, b, c, d);

                MessageBox.Show("Thêm chuyến bay thành công", "Title", MessageBoxButtons.OK, MessageBoxIcon.Information);
                f.Close();
                break;
            }
        }
예제 #2
0
 private void btnreset_Click(object sender, EventArgs e)
 {
     cmdBall.Location = new Point(5, 5);
     Punktestand      = 0;
     count            = 0;
     formcount        = 0;
     thirdform.Close();
     txtPunkte.Text = Convert.ToString(Punktestand);
 }