Esempio n. 1
0
        private bool ValidateInputs()
        {
            if (_startDate != default &&
                _startTime != default &&
                _endDate != default &&
                _endTime != default)
            {
                var start = Utilities.ToDateTime(_startDate, _startTime);
                var end   = Utilities.ToDateTime(_endDate, _endTime);

                if (start > end)
                {
                    _dialogHelper.ShowError(this, "Start Date cannot be after the End Date.");
                    return(false);
                }
            }

            if (titleEditText.IsEmpty() && noteEditText.IsEmpty())
            {
                noteEditText.Error = "Both Description and Title can not be empty.";
                return(false);
            }

            return(true);
        }
Esempio n. 2
0
        private bool ValidateInputs()
        {
            if (usernameEditText.IsEmpty())
            {
                usernameEditText.Error = "Username can not be empty.";
                return(false);
            }

            int requiredUsernameLength = 4;

            if (usernameEditText.Text.Length <= requiredUsernameLength)
            {
                usernameEditText.Error = $"Username must be at least { requiredUsernameLength } characters long.";
                return(false);
            }

            if (emailEditText.IsEmpty())
            {
                emailEditText.Error = "Email can not be empty.";
                return(false);
            }

            if (!Utilities.IsValidEmail(emailEditText.Text))
            {
                emailEditText.Error = "Email is not valid.";
                return(false);
            }

            if (passwordEditText.IsEmpty())
            {
                passwordEditText.Error = "Password can not be empty.";
                return(false);
            }

            int requiredPasswordLength = 4;

            if (passwordEditText.Text.Length <= requiredPasswordLength)
            {
                passwordEditText.Error = $"Password must be at least { requiredPasswordLength } characters long.";
                return(false);
            }

            if (confirmPasswordEditText.IsEmpty())
            {
                confirmPasswordEditText.Error = "Confirm Password can not be empty.";
                return(false);
            }

            if (passwordEditText.Text != confirmPasswordEditText.Text)
            {
                confirmPasswordEditText.Error = "Password and Confirm Password must match.";
                return(false);
            }

            return(true);
        }
Esempio n. 3
0
        private bool ValidateInputs()
        {
            if (usernameEditText.IsEmpty())
            {
                usernameEditText.Error = "Username can not be empty.";
                return(false);
            }

            if (passwordEditText.IsEmpty())
            {
                passwordEditText.Error = "Password can not be empty.";
                return(false);
            }

            return(true);
        }
Esempio n. 4
0
        private bool ValidateInputs()
        {
            if (codeEditText.IsEmpty())
            {
                codeEditText.Error = "Code can not be empty.";
                return(false);
            }

            if (!Regex.IsMatch(codeEditText.Text, "[0-9]{4,}"))
            {
                codeEditText.Error = "Code entered is incorrect";
                return(false);
            }

            if (passwordEditText.IsEmpty())
            {
                passwordEditText.Error = "Password can not be empty.";
                return(false);
            }

            int requiredPasswordLength = 4;

            if (passwordEditText.Text.Length < requiredPasswordLength)
            {
                passwordEditText.Error = $"Password must be at least { requiredPasswordLength } characters long.";
                return(false);
            }

            if (confirmPasswordEditText.IsEmpty())
            {
                confirmPasswordEditText.Error = "Confirm Password can not be empty.";
                return(false);
            }

            if (passwordEditText.Text != confirmPasswordEditText.Text)
            {
                confirmPasswordEditText.Error = "Password and Confirm Password must match.";
                return(false);
            }

            return(true);
        }