private void AttemptLogIn() { LoginValidation login = new LoginValidation(Username, Password, this.ActionOnError); User user = null; if (LoginValidation.ValidateUserInput(ref user)) { Student student = StudentValidation.GetStudentDataByUser(user); if (student == null) { MessageBox.Show("User '" + user.Username + "' does not have field facultyNumber."); Password = ""; OnPropertyChanged("Password"); return; } OnSuccessfulLogin(student); } else { Password = ""; OnPropertyChanged("Password"); } }
private void Login(object parameter) { var _loginValidation = new LoginValidation(Username, Password, ActionOnError); if (_loginValidation.ValidateUserInput(ref _user)) { var studentValidation = new StudentValidation(ActionOnError); if (_user != null) { var student = studentValidation.GetStudentDataByUser(_user); var mainWindow = new MainWindow(student); mainWindow.Show(); _loginWindow.Close(); } } }