コード例 #1
0
ファイル: LoginViewModel.cs プロジェクト: kostadin-kar/ps
        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");
            }
        }
コード例 #2
0
ファイル: LoginViewModel.cs プロジェクト: AlexNRusev/PS
        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();
                }
            }
        }