예제 #1
0
        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);
            }
        }
예제 #2
0
 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];
 }
예제 #3
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
     });
 }
예제 #4
0
 public PersonFlerRelationType ToPersonFlerRelationType(Func <string, Guid> cpr2uuidFunc)
 {
     return(PersonFlerRelationType.Create(cpr2uuidFunc(Converters.ToCprNumber(this.PNR)), null, null));
 }
예제 #5
0
 public string ToSpousePNR()
 {
     return(Converters.ToCprNumber(this.SpousePNR));
 }