public virtual DateTime ToBirthdate() { var birthdate = Converters.ToDateTime(this.Birthdate, this.BirthdateUncertainty); if (birthdate.HasValue) { return(birthdate.Value); } else { return(PartInterface.Strings.PersonNumberToDate(Converters.ToCprNumber(this.PNR)).Value); } }
public PersonRelationType[] ToMother(Func<string, Guid> cpr2uuidFunc) { if (this.MotherPNR > 0) { if (Converters.IsValidCprNumber(this.MotherPNR)) { if (cpr2uuidFunc != null) { return PersonRelationType.CreateList(cpr2uuidFunc(Converters.ToCprNumber(this.MotherPNR))); } else { throw new ArgumentNullException("cpr2uuidFunc"); } } else { throw new ArgumentException("Invalid MotherPNR", "citizen.MotherPNR"); } } return new PersonRelationType[0]; }
public CprBorgerType ToCprBorgerType(DateTime effectDate) { return(new CprBorgerType() { // Not supported AdresseNoteTekst = null, // Set church membership FolkekirkeMedlemIndikator = this.ToChurchMembershipIndicator(), // Set address FolkeregisterAdresse = ToAdresseType(), // Set address indicator ForskerBeskyttelseIndikator = this.ToDirectoryProtectionIndicator(effectDate), // Set ddress protection indicator NavneAdresseBeskyttelseIndikator = this.ToAddressProtectionIndicator(effectDate), // Set CPR number PersonCivilRegistrationIdentifier = Converters.ToCprNumber(this.PNR), // Set nationality (always Danish in this case) PersonNationalityCode = this.ToCountryIdentificationCodeType(), // Set CPR number validity PersonNummerGyldighedStatusIndikator = this.ToCivilRegistrationValidityStatusIndicator(), // Telphone numbers are not supported TelefonNummerBeskyttelseIndikator = false }); }
public PersonFlerRelationType ToPersonFlerRelationType(Func <string, Guid> cpr2uuidFunc) { return(PersonFlerRelationType.Create(cpr2uuidFunc(Converters.ToCprNumber(this.PNR)), null, null)); }
public string ToSpousePNR() { return(Converters.ToCprNumber(this.SpousePNR)); }