Пример #1
0
        ///
        /// <summary>   Event handler. Called by AddressTwoTextbox for text changed events. </summary>
        ///
        /// <remarks>   2019-04-20. </remarks>
        ///
        /// <param name="sender">   Source of the event. </param>
        /// <param name="e">        Text changed event information. </param>
        ///

        private void AddressTwoTextbox_TextChanged(object sender, TextChangedEventArgs e)
        {
            bool isValid = true;

            //Address 2 textbox validation
            isValid = PatientValidation.ValidateAddressLine2(addressTwoTextbox.Text);

            if (!isValid && !String.IsNullOrEmpty(addressTwoTextbox.Text)) //Not valid and not an empty string
            {
                addressTwoBool           = false;
                address2Error.Visibility = Visibility.Visible;
            }
            else //false
            {
                addressTwoBool           = true;
                address2Error.Visibility = Visibility.Hidden;
            }
        }
Пример #2
0
        /// <summary>   Event handler. Called by AddressTwoTextbox for text changed events.
        ///             Ensure a vlaid address, otherwise set it to blank</summary>
        ///
        /// <remarks>   2019-04-20. </remarks>
        ///
        /// <param name="sender">   Source of the event. </param>
        /// <param name="e">        Text changed event information. </param>

        private void AddressTwoTextbox_TextChanged(object sender, TextChangedEventArgs e)
        {
            SubmitError.Visibility = Visibility.Hidden; //Hide the error initally
            bool isValid = true;

            //Validate address two
            isValid = PatientValidation.ValidateAddressLine2(addressTwoTextbox.Text);

            if (!isValid && !String.IsNullOrEmpty(addressTwoTextbox.Text)) //Not valid, string is not empty
            {
                addressTwo = "";
                address2Error.Visibility = Visibility.Visible;
            }
            else //Valid string
            {
                addressTwo = addressTwoTextbox.Text;
                address2Error.Visibility = Visibility.Hidden;
            }
        }