public void AssignUuids(Func <string, Guid> cprToUuidFunc)
 {
     foreach (var rels in new IPersonRelationType[][] {
         this.Aegtefaelle,
         this.Boern,
         this.Bopaelssamling,
         this.ErstatningAf,
         this.ErstatningFor,
         this.Fader,
         this.Foraeldremyndighedsboern,
         this.Foraeldremyndighedsindehaver,
         this.Moder,
         this.RegistreretPartner,
         this.RetligHandleevneVaergeForPersonen,
         this.RetligHandleevneVaergemaalsindehaver
     })
     {
         if (rels != null)
         {
             foreach (var rel in rels)
             {
                 if (rel != null)
                 {
                     rel.ReferenceID = UnikIdType.Create(cprToUuidFunc(rel.CprNumber));
                 }
             }
         }
     }
 }
Exemple #2
0
 public PersonRelationType ToPersonRelationType(Func <string, Guid> cpr2uuidFunc, bool forPreviousInterval)
 {
     return(new PersonRelationType()
     {
         ReferenceID = UnikIdType.Create(cpr2uuidFunc(ToSpousePnr())),
         CommentText = "",
         Virkning = VirkningType.Create(
             forPreviousInterval ? null : _CivilStatus.ToStartTS(),
             forPreviousInterval ? _CivilStatus.ToStartTS() : _CivilStatus.ToEndTS()
             )
     });
 }
Exemple #3
0
 public static TRelation Create <TRelation>(Guid targetUuid, DateTime?fromDate, DateTime?toDate) where TRelation : IPersonRelationType, new()
 {
     if (targetUuid != Guid.Empty)
     {
         return(new TRelation()
         {
             //TODO: Add comment text
             CommentText = null,
             CprNumber = null,
             ReferenceID = UnikIdType.Create(targetUuid),
             // TODO: Fill virkning object from parameters
             Virkning = VirkningType.Create(fromDate, toDate)
         });
     }
     else
     {
         throw new ArgumentNullException("targetUuid");
     }
 }