示例#1
0
 private Location CreateLocation(ContactLocation geoData)
 {
   if (geoData.Latitude == null || geoData.Longitude == null)
     return null;
   return new Location()
         {
           City = geoData.City,
           Country = geoData.Country
         };
 }
示例#2
0
        public static SimpleZipCode GetZipInfo(this ContactLocation location)
        {
            int zip;

            if (!int.TryParse(location.PostalCode, out zip))
            {
                return(null);
            }
            return((SimpleZipCode)ZipInfoManager.Get(zip));
        }
示例#3
0
 private Location CreateLocation(ContactLocation geoData)
 {
     if (geoData.Latitude == null || geoData.Longitude == null)
     {
         return(null);
     }
     return(new Location()
     {
         City = geoData.City,
         Country = geoData.Country
     });
 }
示例#4
0
        /// <inheritdoc/>
        public string ToDelimitedString()
        {
            CultureInfo culture = CultureInfo.CurrentCulture;

            return(string.Format(
                       culture,
                       StringHelper.StringFormatSequence(0, 8, Configuration.FieldSeparator),
                       Id,
                       ContactRole != null ? string.Join(Configuration.FieldRepeatSeparator, ContactRole.Select(x => x.ToDelimitedString())) : null,
                       ContactName != null ? string.Join(Configuration.FieldRepeatSeparator, ContactName.Select(x => x.ToDelimitedString())) : null,
                       ContactAddress != null ? string.Join(Configuration.FieldRepeatSeparator, ContactAddress.Select(x => x.ToDelimitedString())) : null,
                       ContactLocation?.ToDelimitedString(),
                       ContactCommunicationInformation != null ? string.Join(Configuration.FieldRepeatSeparator, ContactCommunicationInformation.Select(x => x.ToDelimitedString())) : null,
                       PreferredMethodOfContact?.ToDelimitedString(),
                       ContactIdentifiers != null ? string.Join(Configuration.FieldRepeatSeparator, ContactIdentifiers.Select(x => x.ToDelimitedString())) : null
                       ).TrimEnd(Configuration.FieldSeparator.ToCharArray()));
        }
 private Location CreateLocation(ContactLocation geoData)
 {
     if (geoData.Latitude == null || geoData.Longitude == null)
     {
         return(null);
     }
     return(new Location
     {
         BusinessName = geoData.BusinessName,
         Url = geoData.Url,
         City = geoData.City,
         Region = geoData.Region,
         Country = geoData.Country,
         Latitude = string.Format(CultureInfo.InvariantCulture, "{0:0.#######}", geoData.Latitude),
         Longitude = string.Format(CultureInfo.InvariantCulture, "{0:0.#######}", geoData.Longitude),
     });
 }