Exemplo n.º 1
0
        ///*********************************************************************************/
        private void onConfirmLoginButtonClick(object sender, EventArgs e)
        {
            // Authenticate
            signInHelper = new SignInHelper(usernameBox.Text, passwordBox.Password, Data.Users);
            if (!signInHelper.isValidEntry())
            {
                usernameBox.Clear();
                passwordBox.Clear();
                usernameBox.Background = new SolidColorBrush(Color.FromRgb(240, 152, 152));
                passwordBox.Background = new SolidColorBrush(Color.FromRgb(240, 152, 152));
                return;
            }

            if (signInHelper.isValidateUsername())
            {
                if (signInHelper.isValidPassword())
                {
                    CollapseAll();
                    usernameBox.Clear();
                    passwordBox.Clear();

                    isSignedIn          = true;
                    loginButton.Content = "Sign Out";

                    mainScroll.Visibility = Visibility.Visible;
                }

                else
                {
                    passwordBox.Clear();
                    passwordBox.Background = new SolidColorBrush(Color.FromRgb(240, 152, 152));
                    return;
                }
            }

            else
            {
                usernameBox.Clear();
                passwordBox.Clear();
                usernameBox.Background = new SolidColorBrush(Color.FromRgb(240, 152, 152));
                return;
            }
        }