private bool ValidateInput() { //Check name if (String.IsNullOrEmpty(NameInput.Text) || NameInput.Text.Length < 3) { NameErrorLabel.Text = ValidationMessages.NameMin; NameErrorLabel.IsVisible = true; return(false); } NameErrorLabel.IsVisible = false; //Check surname if (String.IsNullOrEmpty(SurnameInput.Text) || SurnameInput.Text.Length < 3) { SurnameErrorLabel.Text = ValidationMessages.NameMin; SurnameErrorLabel.IsVisible = true; return(false); } SurnameErrorLabel.IsVisible = false; //Check email if (!FormDataHelper.IsEmailValid(EmailInput.Text)) { EmailErrorLabel.Text = ValidationMessages.IncorrectEmail; EmailErrorLabel.IsVisible = true; return(false); } EmailErrorLabel.IsVisible = false; //Check password if (String.IsNullOrEmpty(PasswordInput.Text) || PasswordInput.Text.Length < 6) { PasswordErrorLabel.Text = ValidationMessages.PasswordMin; PasswordErrorLabel.IsVisible = true; return(false); } PasswordErrorLabel.IsVisible = false; //Check passwords equality if (String.IsNullOrEmpty(PasswordInput.Text) || !ConfirmPasswordInput.Text.Equals(PasswordInput.Text)) { ConfirmPasswordErrorLabel.Text = ValidationMessages.PasswordsNotEqual; ConfirmPasswordErrorLabel.IsVisible = true; return(false); } ConfirmPasswordErrorLabel.IsVisible = false; return(true); }
private bool ValidateInput() { //Check email if (!FormDataHelper.IsEmailValid(Email.Text)) { EmailErrorLabel.Text = ValidationMessages.IncorrectEmail; EmailErrorLabel.IsVisible = true; return(false); } EmailErrorLabel.IsVisible = false; //Check password if (String.IsNullOrEmpty(Password.Text) || Password.Text.Length < 6) { PasswordErrorLabel.Text = ValidationMessages.PasswordMin; PasswordErrorLabel.IsVisible = true; return(false); } PasswordErrorLabel.IsVisible = false; return(true); }