//******************************************************************* // Runs on any attempt the user makes to log into the application. // Captures the user data and passes it to Subwindow1 if login is valid. Closes current window and opens main menu window. // On an invalid login, prompts the user to try again. //******************************************************************* private void AttemptLogin() { if (AdidPass_IsValid()) { user_data = FillUserData(); UserMenu_Window userMenu = new UserMenu_Window(user_data); this.Close(); userMenu.Show(); } else { MessageBox.Show("Login failed. Try again."); ADIDtext.Clear(); Passwordtext.Clear(); } }
//******************************************************************* // Runs on any attempt the user makes to log into the application. // Captures the user data and passes it to Subwindow1 if login is valid. Closes current window and opens main menu window. // On an invalid login, prompts the user to try again. //******************************************************************* private void AttemptLogin() { if (Passwordtext.Password.ToString().Length == 4) { ResetPassword reset = new ResetPassword(user_data); this.Close(); reset.Show(); user_data = FillUserData(); ResetPassword resetPassword = new ResetPassword(user_data); this.Close(); resetPassword.Show(); } else { if (AdidPass_IsValid()) { user_data = FillUserData(); if (isEDI(user_data)) { MenuScreen menuScreen = new MenuScreen(user_data); this.Close(); menuScreen.Show(); } else { MenuScreen menuScreen = new MenuScreen(user_data); this.Close(); menuScreen.Show(); } } else { MessageBox.Show("Login failed. Try again."); ADIDtext.Clear(); Passwordtext.Clear(); } } }