private void btnLogout_Click(object sender, EventArgs e) { DialogYesNo yesno = new DialogYesNo(); yesno.ShowDialog(); if (yesno.getresult()) { Program.resetLogin(); this.Hide(); FormLogin formLogin = new FormLogin(); formLogin.Show(); } }
public bool removeQuery(string qCommand, string successMsg, int sucX, int sucY) { DialogYesNo yesno = new DialogYesNo(); yesno.ShowDialog(); if (yesno.getresult()) { query = qCommand; SqlCommand command = new SqlCommand(query, sqlConn); sqlConn.Open(); command.ExecuteNonQuery(); DialogNormal dialog = new DialogNormal("Notice", successMsg, sucX, sucY); dialog.ShowDialog(); sqlConn.Close(); return(true); } return(false); }