/// <summary> /// Returns a boolean based on is Value is a USA ZIP Code /// </summary> /// <param name="value"></param> /// <returns></returns> /// RETURNS TRUE WHEN GIVEN NULL TO STAY CONSISTENT WITH POSTAL CODE public static Boolean ZIPCodeUSAValidate(String value) { if (String.IsNullOrEmpty(value)) { return(true); } value = NSStringUtilities.ZIPCodeUSAFormat(value); if (value == null) { return(false); } else { return(true); } }
/// <summary> /// Returns a boolean based on is Value is a Canadian Postal Code /// </summary> /// <param name="value"></param> /// <returns></returns> public static Boolean PostalCodeCanadaValidate(String value) { if (String.IsNullOrEmpty(value)) { return(true); } value = NSStringUtilities.PostalCodeCanadaFormat(value); if (value == null) { return(false); } else { return(true); } }
/// <summary> /// Returns a boolean based on is Value is a Phone Number /// </summary> /// <param name="value"></param> /// <returns></returns> /// /// RETURNS TRUE WHEN GIVEN NULL TO STAY CONSISTENT WITH POSTAL CODE public static Boolean TelephoneNumberValidate(String value) { if (String.IsNullOrEmpty(value)) { return(true); } value = NSStringUtilities.TelephoneNumberFormat(value); if (value == null) { return(false); } else if (value.Length == 12) // 12 because above method adds dashes { return(true); } else { return(false); } }