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

            locationAddressAndPhone.ReviseLocationAddress(
                new LocationAddress(
                    locationAddressType,
                    new AddressBuilder().WithFirstStreetAddress(locationAddressDto.FirstStreetAddress).WithSecondStreetAddress(
                        locationAddressDto.SecondStreetAddress).WithCityName(locationAddressDto.CityName).WithCountyArea(countyArea)
                    .WithStateProvince(stateProvince).WithCountry(country).WithPostalCode(new PostalCode(locationAddressDto.PostalCode)),
                    locationAddressDto.ConfidentialIndicator));

            MapLocationPhone(locationAddressAndPhone, locationAddressDto);
        }
예제 #2
0
 private void RemoveLocationAddress(
     LocationAddressAndPhoneDto locationAddressAndPhoneDto, Location location, LocationAddressAndPhone locationAddressAndPhone)
 {
     location.RemoveAddressAndPhone(locationAddressAndPhone);
 }
예제 #3
0
 private void MapLocationPhone(LocationAddressAndPhone locationAddressAndPhone, LocationAddressAndPhoneDto locationAddressDto)
 {
     _mappingResult &=
         new AggregateNodeCollectionMapper <LocationPhoneDto, LocationAddressAndPhone, LocationPhone> (
             locationAddressDto.PhoneNumbers, locationAddressAndPhone, locationAddressAndPhone.PhoneNumbers).MapAddedItem(AddLocationPhone)
         .MapChangedItem(ChangeLocationPhone).MapRemovedItem(RemoveLocationPhone).Map();
 }