コード例 #1
0
        private static void AddContactInfo(Listing25 listing, Place place)
        {
            if (listing.ContactInfo == null)
                return;

            place.PhoneNumber = GetPhoneNumber(listing.ContactInfo);
            place.WebSite = GetWebSite(listing.ContactInfo.Websites);
        }
コード例 #2
0
        public Place Create(Listing25 listing)
        {
            var place = new Place { Id = listing.ListingId, Name = listing.Name };

            AddContactInfo(listing, place);
            AddAddressInfo(listing, place);

            decimal distance;
            if (decimal.TryParse(listing.Distance, out distance))
                place.Distance = distance;

            return place;
        }
コード例 #3
0
        private static void AddAddressInfo(Listing25 listing, Place place)
        {
            if (listing.Locations.IsNullOrEmpty())
                return;

            var sourceAddress = listing.Locations[0];

            place.Address = new Address
                                {
                                    Address1 = sourceAddress.Address1,
                                    Address2 = sourceAddress.Address2,
                                    City = sourceAddress.City,
                                    State = sourceAddress.State,
                                    ZipCode = sourceAddress.Zip,
                                    Latitude = sourceAddress.Latitude,
                                    Longitude = sourceAddress.Longitude
                                };
        }