private void buttonBack_Click(object sender, EventArgs e) { if (File.Exists(@"..\" + "temp.txt")) { File.Delete(@"..\" + "temp.txt"); } TicketManagement objj = new TicketManagement(); this.Hide(); objj.ShowDialog(); this.Close(); }
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"); } }