public void DisposeSamples() { NumberOfAdressObjects.DisposeSamples(); HasAdressLine12or3.DisposeSamples(); GivenMultipleAdressObject_HasSameNinAsPersonObject.DisposeSamples(); HasAdressLine1_WhenHasAdressLine12or3.DisposeSamples(); HasAdressLine2_WhenHasAdressLine12or3.DisposeSamples(); HasAdressLine3_WhenHasAdressLine12or3.DisposeSamples(); HasAppartmentNumber.DisposeSamples(); HasBasicStatisticalUnit.DisposeSamples(); HasCadastralNumber.DisposeSamples(); HasCoAdress.DisposeSamples(); HasConstituency.DisposeSamples(); HasCountry.DisposeSamples(); IsCurrentAdress.DisposeSamples(); HasDateAdrFrom.DisposeSamples(); HasDatePostalPlace.DisposeSamples(); HasDistrictCodeandDistrictName.DisposeSamples(); HasHouseLetter.DisposeSamples(); HasHouseNumber.DisposeSamples(); HasSameNinAsPersonObject.DisposeSamples(); HasPostalAdress.DisposeSamples(); HasPostalAddressValidFrom.DisposeSamples(); HasPostalCode.DisposeSamples(); HasPostalPlace.DisposeSamples(); PostalType.DisposeSamples(); HasPropertyNumber.DisposeSamples(); HasSchoolDistrict.DisposeSamples(); HasSt.DisposeSamples(); HasStreetname.DisposeSamples(); HasStreetnumber.DisposeSamples(); HasXcoordYcoord.DisposeSamples(); }
public void FromImport(Person p, int ageQuant) { NumberOfAdressObjects.Update(p.Addresses?.Length ?? 0); if (p.Addresses == null) { return; } var adress = GetCurrent(p.Addresses); if (CommonFunctions.HasDnummer(p.NIN)) { GivenHasDnummer_KommuneNr.Update(adress.St); } var hasAdr = IsNotNullOrEmptyOrWhitespace(adress.AddressLine1) || IsNotNullOrEmptyOrWhitespace(adress.AddressLine2) || IsNotNullOrEmptyOrWhitespace(adress.AddressLine3); HasAdressLine12or3.Update(hasAdr ? 1 : 0); if (hasAdr) { HasAdressLine1_WhenHasAdressLine12or3.Update(IsNotNullOrEmptyOrWhitespace(adress.AddressLine1) ? 1 : 0); HasAdressLine2_WhenHasAdressLine12or3.Update(IsNotNullOrEmptyOrWhitespace(adress.AddressLine2) ? 1 : 0); HasAdressLine3_WhenHasAdressLine12or3.Update(IsNotNullOrEmptyOrWhitespace(adress.AddressLine3) ? 1 : 0); } HasAppartmentNumber.Update(IsNotNullOrEmptyOrWhitespace(adress.ApartmentNumber) ? 1 : 0); HasCoAdress.Update(IsNotNullOrEmptyOrWhitespace(adress.CoAddress) ? 1 : 0); HasCountry.Update(IsNotNullOrEmptyOrWhitespace(adress.Country) ? 1 : 0); HasDateAdrFrom.Update(adress.DateAdrFrom.HasValue ? 1 : 0); HasDatePostalPlace.Update(adress.DatePostalType.HasValue ? 1 : 0); HasHouseLetter.Update(IsNotNullOrEmptyOrWhitespace(adress.HouseLetter) ? 1 : 0); HasHouseNumber.Update(adress.HouseNumber.HasValue ? 1 : 0); HasPostalAddressValidFrom.Update(adress.PostalAddressValidFrom.HasValue ? 1 : 0); HasPostalAdress.Update(IsNotNullOrEmptyOrWhitespace(adress.PostalAddress) ? 1 : 0); HasPostalCode.Update(IsNotNullOrEmptyOrWhitespace(adress.PostalCode) ? 1 : 0); HasPostalPlace.Update(IsNotNullOrEmptyOrWhitespace(adress.PostalPlace) ? 1 : 0); PostalType.Update(adress.PostalType); HasSameNinAsPersonObject.Update(adress.NIN == p.NIN ? 1 : 0); HasSchoolDistrict.Update(IsNotNullOrEmptyOrWhitespace(adress.SchoolDistrict) ? 1 : 0); HasSt.Update(IsNotNullOrEmptyOrWhitespace(adress.St) ? 1 : 0); HasStreetname.Update(IsNotNullOrEmptyOrWhitespace(adress.StreetName) ? 1 : 0); HasStreetnumber.Update(IsNotNullOrEmptyOrWhitespace(adress.StreetNumber) ? 1 : 0); HasXcoordYcoord.Update(adress.XCoord.HasValue || adress.YCoord.HasValue ? 1 : 0); HasBasicStatisticalUnit.Update(adress.BasicStatisticalUnit.HasValue ? 1 : 0); HasCadastralNumber.Update(IsNotNullOrEmptyOrWhitespace(adress.CadastralNumber) ? 1:0); HasConstituency.Update(IsNotNullOrEmptyOrWhitespace(adress.Constituency) ? 1 : 0); HasDistrictCodeandDistrictName.Update(IsNotNullOrEmptyOrWhitespace(adress.DistrictCode) || IsNotNullOrEmptyOrWhitespace(adress.DistrictName) ? 1 : 0); HasPropertyNumber.Update(IsNotNullOrEmptyOrWhitespace(adress.PropertyNumber) ? 1 : 0); if (PersonStatistics.IsPersonDead(p) == 1) { HasPostalCodeGivenIsDead.Update(IsNotNullOrEmptyOrWhitespace(adress.PostalCode) ? 1 : 0); } if (p.Addresses.Length > 1) { foreach (var obsoleteAdress in p.Addresses.Where(a => !a.CurrentAddress)) { GivenMultipleAdressObject_HasSameNinAsPersonObject.Update(obsoleteAdress.NIN == p.NIN ? 1 : 0); } } }