Пример #1
0
        private int CheckUser()
        {
            bool check;
            int  i = 0;

            check = ErrorControls.NotEmptyTextBox(tbLogin) &&
                    ErrorControls.RegexTextBox(tbLogin, "^[a-z]+$");
            ErrorControls.CountErrors(ref i, check);

            check = ErrorControls.NotEmptyTextBox(tbLoginSkype) &&
                    ErrorControls.RegexTextBox(tbLoginSkype, "^[a-z]+$");
            ErrorControls.CountErrors(ref i, check);

            check = ErrorControls.NotEmptyTextBox(tbEmail) &&
                    ErrorControls.RegexTextBox(tbEmail, "^[0-9a-z_\\.-]+@[0-9a-z_\\.-]+\\.[a-z]{2,}?$");
            ErrorControls.CountErrors(ref i, check);

            check = ErrorControls.NotEmptyPasswordBox(tbPass) &&
                    ErrorControls.NotEmptyPasswordBox(tbRepeatPass) &&
                    (tbPass.Password == tbRepeatPass.Password);
            if (!check)
            {
                tbPass.Background       = Brushes.Red;
                tbRepeatPass.Background = Brushes.Red;
            }
            ErrorControls.CountErrors(ref i, check);

            return(i);
        }
Пример #2
0
        private int CheckUser()
        {
            bool check;
            int  i = 0;

            check = ErrorControls.NotEmptyTextBox(tbLogin) &&
                    ErrorControls.RegexTextBox(tbLogin, "^[a-z]+$");
            ErrorControls.CountErrors(ref i, check);
            lbError.Visibility = (check) ? Visibility.Hidden : Visibility.Visible;

            check = ErrorControls.NotEmptyPasswordBox(tbPass);
            ErrorControls.CountErrors(ref i, check);

            return(i);
        }