예제 #1
0
        private void AddLocationAddress(LocationAddressAndPhoneDto locationAddressAndPhoneDto, Location location)
        {
            var locationAddressType = _mappingHelper.MapLookupField <LocationAddressType> (locationAddressAndPhoneDto.LocationAddressType);
            var stateProvince       = _mappingHelper.MapLookupField <StateProvince> (locationAddressAndPhoneDto.StateProvince);
            var countyArea          = _mappingHelper.MapLookupField <CountyArea> (locationAddressAndPhoneDto.CountyArea);
            var country             = _mappingHelper.MapLookupField <Country> (locationAddressAndPhoneDto.Country);

            var locationAddress =
                location.AddAddressAndPhone(
                    new LocationAddress(
                        locationAddressType,
                        new AddressBuilder().WithFirstStreetAddress(locationAddressAndPhoneDto.FirstStreetAddress).WithSecondStreetAddress(
                            locationAddressAndPhoneDto.SecondStreetAddress).WithCityName(locationAddressAndPhoneDto.CityName).WithCountyArea(
                            countyArea).WithStateProvince(stateProvince).WithCountry(country).WithPostalCode(
                            new PostalCode(locationAddressAndPhoneDto.PostalCode)),
                        locationAddressAndPhoneDto.ConfidentialIndicator));

            MapLocationPhone(locationAddress, locationAddressAndPhoneDto);
        }