private void AddStaffAddress(StaffAddressDto staffAddressDto, Staff staff) { var addressType = _mappingHelper.MapLookupField <StaffAddressType> (staffAddressDto.StaffAddressType); var countyAreaLookup = _mappingHelper.MapLookupField <CountyArea> (staffAddressDto.CountyArea); var stateProvinceLookup = _mappingHelper.MapLookupField <StateProvince> (staffAddressDto.StateProvince); var staffAddress = new StaffAddressBuilder().WithStaffAddressType(addressType).WithAddress( new AddressBuilder().WithFirstStreetAddress(staffAddressDto.FirstStreetAddress).WithSecondStreetAddress( staffAddressDto.SecondStreetAddress).WithCityName(staffAddressDto.CityName).WithCountyArea(countyAreaLookup) .WithStateProvince(stateProvinceLookup).WithPostalCode(new PostalCode(staffAddressDto.PostalCode))); staff.AddAddress(staffAddress); }
private void ChangeStaffAddress(StaffAddressDto dto, Staff staff, StaffAddress staffAddress) { RemoveStaffAddress(dto, staff, staffAddress); AddStaffAddress(dto, staff); }
private void RemoveStaffAddress(StaffAddressDto dto, Staff staff, StaffAddress staffAddress) { staff.RemoveAddress(staffAddress); }