private void PhoneNumberTextBox_Leave(object sender, EventArgs e)
 {
     if (!DataConsistency.ValidPhoneNumber(PhoneNumberTextBox.Text))
     {
         OtherFunctions.Message("Invalid phone number.", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, "Error", this);
     }
 }
 private void PhoneNumTextBox_Leave(object sender, EventArgs e)
 {
     if (PhoneNumTextBox.Text.ToString().Trim() != "" && !DataConsistency.ValidPhoneNumber(PhoneNumTextBox.Text))
     {
         OtherFunctions.Message("Invalid phone number.", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, "Error", this);
         PhoneNumTextBox.Focus();
     }
 }
        private bool FieldsValid()
        {
            bool fieldsValid = true;

            fieldsValid = controlParser.ValidateFields();
            if (!DataConsistency.ValidPhoneNumber(PhoneNumberTextBox.Text))
            {
                fieldsValid = false;
                controlParser.SetError(PhoneNumberTextBox, false);
            }
            else
            {
                controlParser.SetError(PhoneNumberTextBox, true);
            }
            return(fieldsValid); //if fields are missing return false to trigger a message if needed
        }
        private bool CheckFields()
        {
            bool validFields = true;

            validFields = controlParser.ValidateFields();

            LockUnlockUserField();

            if (PhoneNumTextBox.Text.Trim() != "" && !DataConsistency.ValidPhoneNumber(PhoneNumTextBox.Text))
            {
                validFields = false;
                controlParser.SetError(PhoneNumTextBox, false);
                OtherFunctions.Message("Invalid phone number.", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, "Error", this);
            }

            return(validFields);
        }