Пример #1
0
        public RelationListeType ToRelationListeType(Func <string, Guid> cpr2UuidFunc)
        {
            // Marriages
            var civilStates = Interval
                              .CreateFromData <TimedTypeWrapper <ICivilStatus> >(this.ItemsAsTimedType, new DataTypeTags[] { DataTypeTags.CivilStatus })
                              .Select(w => w.TimedObject)
                              .ToList();
            var spouses  = CivilStatusWrapper.ToSpouses(null, civilStates, cpr2UuidFunc);
            var partners = CivilStatusWrapper.ToRegisteredPartners(null, civilStates, cpr2UuidFunc);

            // Now fill the return object
            return(new RelationListeType()
            {
                Aegtefaelle = spouses,
                RegistreretPartner = partners,
                Fader = FromLatestRegistration <ParentsInformationType>().ToFather(cpr2UuidFunc),
                Moder = FromLatestRegistration <ParentsInformationType>().ToMother(cpr2UuidFunc),
                Boern = ChildType.ToPersonFlerRelationType(LatestRegistration.Child, cpr2UuidFunc),
                RetligHandleevneVaergemaalsindehaver = ToRetligHandleevneVaergemaalsindehaver(cpr2UuidFunc),
                Foraeldremyndighedsindehaver = ToForaeldremyndighedsindehaver(cpr2UuidFunc),
                Bopaelssamling = null,
                ErstatningAf = ToErstatningAf(cpr2UuidFunc),
                ErstatningFor = null,
                Foraeldremyndighedsboern = null,
                LokalUdvidelse = null,
                RetligHandleevneVaergeForPersonen = null
            });
        }
Пример #2
0
        public RelationListeType ToRelationListeType(Func <string, Guid> cpr2uuidConverter, DPRDataContext dataContext)
        {
            Func <decimal, Guid> cpr2uuidFunc = (cpr) => cpr2uuidConverter(cpr.ToPnrDecimalString());

            var ret = new RelationListeType();
            // Now fill the relations
            var fatherPnr = Utilities.ToParentPnr(this.PersonTotal.FatherPersonalOrBirthdate);

            if (fatherPnr.HasValue)
            {
                ret.Fader = new PersonRelationType[]
                {
                    PersonRelationType.Create(
                        cpr2uuidFunc(fatherPnr.Value),
                        null,
                        null
                        )
                };
            }

            var motherPnr = Utilities.ToParentPnr(this.PersonTotal.MotherPersonalOrBirthDate);

            if (motherPnr.HasValue)
            {
                ret.Moder = new PersonRelationType[]
                {
                    PersonRelationType.Create
                        (cpr2uuidFunc(motherPnr.Value),
                        null,
                        null
                        )
                };
            }

            // Fill children (including adults)
            ret.Boern = Child.ToPersonFlerRelationTypeArray(Children, cpr2uuidFunc);

            // TODO : Fill custody children
            ret.Foraeldremyndighedsboern = null;

            // Normal spouse(s)
            ret.Aegtefaelle = CivilStatusWrapper.ToSpouses(null, this.CivilStatesAsInterface, cpr2uuidConverter);

            // Registered partner(s)
            ret.RegistreretPartner = CivilStatusWrapper.ToRegisteredPartners(null, this.CivilStatesAsInterface, cpr2uuidConverter);

            //TODO: Has legal authority on
            ret.RetligHandleevneVaergeForPersonen = null;

            //TODO: People who have legal authority on this person
            ret.Foraeldremyndighedsindehaver = null;

            return(ret);
        }
 public PersonRelationType[] ToRegisteredPartners(Func <string, Guid> cpr2uuidFunc)
 {
     return(CivilStatusWrapper.ToRegisteredPartners(this.CurrentCivilStatus, this.HistoricalCivilStatusAsInterface, cpr2uuidFunc));
 }