Пример #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ExtendedAddress"/> class.
 /// </summary>
 /// <param name="streetAddress">XAD.1 - Street Address.</param>
 /// <param name="city">XAD.3 - City.</param>
 /// <param name="stateOrProvince">XAD.4 - State or Province.</param>
 /// <param name="zipOrPostalCode">XAD.5 - Zip or Postal Code.</param>
 public ExtendedAddress(StreetAddress streetAddress, string city, string stateOrProvince, string zipOrPostalCode)
 {
     StreetAddress   = streetAddress;
     City            = city;
     StateOrProvince = stateOrProvince;
     ZipOrPostalCode = zipOrPostalCode;
 }
Пример #2
0
        /// <inheritdoc/>
        public string ToDelimitedString()
        {
            System.Globalization.CultureInfo culture = System.Globalization.CultureInfo.CurrentCulture;
            string separator = IsSubcomponent ? Configuration.SubcomponentSeparator : Configuration.ComponentSeparator;

            return(string.Format(
                       culture,
                       StringHelper.StringFormatSequence(0, 14, separator),
                       StreetAddress?.ToDelimitedString(),
                       OtherDesignation,
                       City,
                       StateOrProvince,
                       ZipOrPostalCode,
                       Country,
                       AddressType,
                       OtherGeographicDesignation,
                       CountyParishCode,
                       CensusTract,
                       AddressRepresentationCode,
                       AddressValidityRange?.ToDelimitedString(),
                       EffectiveDate.HasValue ? EffectiveDate.Value.ToString(Consts.DateTimeFormatPrecisionSecond, culture) : null,
                       ExpirationDate.HasValue ? ExpirationDate.Value.ToString(Consts.DateTimeFormatPrecisionSecond, culture) : null
                       ).TrimEnd(separator.ToCharArray()));
        }