private void logoutToolStripMenuItem_Click(object sender, EventArgs e) { if (!LoggedInDetails.GetLoggedInState()) { // login openForm(new FormLogin()); } else { //logout LoggedInDetails.SetLoggedInState(false); } setLoginLogoutState(LoggedInDetails.GetLoggedInState()); setTsUserName(); }
private void btn_Login_Click(object sender, EventArgs e) { var userRepository = new UserRepository(); var response = userRepository.Login(txtBox_login.Text, txtbox_password.Text); if (response == LoginEnum.Successful) { LoggedInDetails.SetUserLogged(txtBox_login.Text); LoggedInDetails.SetLoggedInState(true); Close(); return; } if (response == LoginEnum.IncorrectLogin) { GeneralTools.WarningBox("Incorrect login."); } if (response == LoginEnum.IncorrectPassword) { GeneralTools.WarningBox("Incorrect password."); } }
private void FormLogin_Load(object sender, EventArgs e) { LoggedInDetails.SetLoggedInState(); }