Example #1
0
 public PersonRelationType[] ToSpouses(CivilStatusKodeType existingStatusCode, CivilStatusKodeType[] terminatedStatusCodes, bool sameGenderSpouseForDead, Func<string, Guid> cpr2uuidFunc)
 {
     if (cpr2uuidFunc != null)
     {
         if (this.SpousePNR > 0)
         {
             var status = Converters.ToCivilStatusKodeType(this.MaritalStatus);
             if (status == CivilStatusKodeType.Ugift // Dead
                 && this.Spouse != null
                 && sameGenderSpouseForDead == (this.Gender == this.Spouse.Gender)
                 )
             {
                 return PersonRelationType.CreateList(cpr2uuidFunc(this.ToSpousePNR()), null, this.ToMaritalStatusDate());
             }
             else if (status == existingStatusCode) // Married or registered partner
             {
                 return PersonRelationType.CreateList(cpr2uuidFunc(this.ToSpousePNR()), this.ToMaritalStatusDate(), null);
             }
             else if (terminatedStatusCodes.Contains(status)) // Terminated relationship (divorced, widow...)
             {
                 return PersonRelationType.CreateList(cpr2uuidFunc(this.ToSpousePNR()), null, this.ToMaritalStatusDate());
             }
         }
         return new PersonRelationType[0];
     }
     else
     {
         throw new ArgumentNullException("cpr2uuidFunc");
     }
 }
Example #2
0
 public CivilStatusType ToCivilStatusType()
 {
     return(new CivilStatusType()
     {
         CivilStatusKode = Converters.ToCivilStatusKodeType(this.MaritalStatus),
         TilstandVirkning = TilstandVirkningType.Create(ToMaritalStatusDate())
     });
 }