private static Boolean validateUser() { try { UserLogIn ul = new UserLogIn(); ul.ShowDialog(); if (isLoggedOn) { System.Windows.Forms.Application.Run(new MainForm()); return(true); } else { return(false); } return(false); } catch (Exception ex) { MessageBox.Show(ex.Message); return(false); } }
private void logOutToolStripMenuItem_Click(object sender, EventArgs e) { Program.isLoggedOn = false; UserLogIn userlog = new UserLogIn(); Close(); userlog.Show(); }
//protected override void OnFormClosing(FormClosingEventArgs e) //{ // var exit = MessageBox.Show("Are you sure you want to exit?", "Confirm Exit", MessageBoxButtons.YesNo, MessageBoxIcon.Question); // e.Cancel = (exit == DialogResult.No); // //base.OnFormClosing(e); //} private void Log_out(object sender, EventArgs e) { Program.isLoggedOn = false; UserLogIn userlog = new UserLogIn(); this.Hide(); userlog.Show(); }