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); }
private void RemoveLocationAddress( LocationAddressAndPhoneDto locationAddressAndPhoneDto, Location location, LocationAddressAndPhone locationAddressAndPhone) { location.RemoveAddressAndPhone(locationAddressAndPhone); }
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(); }