Exemplo n.º 1
0
        // Check user credentials and enable login if correct credentials
        private void Login_Click(object sender, RoutedEventArgs e)
        {
            //var isCorrectCreds = CheckUserCredentials(UserNameTextBox.Text, PasswordTextBox.Text);
            var validAppUser = UserLogin.CheckUserCredentials(UserNameTextBox.Text, PasswordTextBox.Text);

            if (validAppUser != null)
            {
                _mainWindow.CurrentUserName = validAppUser.UserName;

                _mainWindow.LogInApproved(validAppUser.UserType);

                if (!_useAdminCreds)
                {
                    ClearUserNameAndPasswordTextBoxes();
                }

                this.Close();
            }
        }