static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); initLogger(); CheckDatabase(); if (DEBUG_MODE) { SeedDebugDatabase(); } Login_Form loginForm = new Login_Form(); if (loginForm.ShowDialog() == DialogResult.OK) { currentUser = loginForm.currentUser; Application.Run(new MainMenu_Form(currentUser)); } else { Application.Exit(); } }
private void LogOutAndReopen() { Login_Form loginForm = new Login_Form(); this.Visible = false; mainMenuOpen = false; if (loginForm.ShowDialog() == DialogResult.OK) { currentUser = loginForm.currentUser; currentShift = currentUser.GetOpenShift(); lastShift = null; InitializeFormElements(); this.Visible = true; chkVehicleLocked.Checked = true; if (btnReview.Visible == false) { this.Size = DEFAULT_SIZE; lblLastShift.Visible = false; lblLastShiftInformation.Visible = false; btnCloseReviewShifts.Visible = false; btnMoreShiftInformation.Visible = false; btnReview.Visible = true; } mainMenuOpen = true; } else { Application.Exit(); } }