コード例 #1
0
        private void buttonMainMenu_Click(object sender, EventArgs e)
        {
            if (File.Exists(@"..\" + "temp.txt"))
            {
                File.Delete(@"..\" + "temp.txt");
            }
            OptionMenu obj = new OptionMenu();

            this.Hide();
            obj.ShowDialog();
            this.Close();
        }
コード例 #2
0
        private void buttonSubmit_Click(object sender, EventArgs e)
        {
            DataBase DB = new DataBase();

            if (DB.connectionTest())
            {
                OptionMenu Op = new OptionMenu();
                if (take == 1)
                {
                    if (DB.loginTest(textBoxUserName.Text, textBoxPassword.Text))
                    {
                        TicketManagement obj = new TicketManagement();
                        this.Hide();
                        obj.ShowDialog();
                        this.Close();
                    }
                    else
                    {
                        Op.take = 0;
                        MessageBox.Show("Wrong User Name or Password");
                    }
                }
                if (take == 2)
                {
                    if (DB.ATCloginTest(textBoxUserName.Text, textBoxPassword.Text))
                    {
                        FlightControl obj = new FlightControl();
                        this.Hide();
                        obj.ShowDialog();
                        this.Close();
                    }
                    else
                    {
                        Op.take = 0;
                        MessageBox.Show("Wrong User Name or Password");
                    }
                }
            }
            else
            {
                MessageBox.Show("Database Connection Error");
            }
        }