コード例 #1
0
        public static RegisterOplysningType ToRegisterOplysningType(PersonAttributes db)
        {
            if (db != null)
            {
                var ret = new RegisterOplysningType();

                if (db.CprData != null)
                {
                    ret.Item = CprData.ToXmlType(db.CprData);
                }
                else if (db.ForeignCitizenData != null)
                {
                    ret.Item = ForeignCitizenData.ToXmlType(db.ForeignCitizenData);
                }
                else if (db.UnknownCitizenData != null)
                {
                    ret.Item = UnknownCitizenData.ToXmlType(db.UnknownCitizenData);
                }

                if (ret.Item != null)
                {
                    ret.Virkning = Effect.ToVirkningType(db.Effect);
                    return(ret);
                }
            }
            return(null);
        }
コード例 #2
0
        public static void SetChildLoadOptions(DataLoadOptions loadOptions)
        {
            loadOptions.LoadWith <PersonAttributes>(pa => pa.Effect);
            loadOptions.LoadWith <PersonAttributes>(pa => pa.PersonProperties);
            loadOptions.LoadWith <PersonAttributes>(pa => pa.CprData);
            loadOptions.LoadWith <PersonAttributes>(pa => pa.ForeignCitizenData);
            loadOptions.LoadWith <PersonAttributes>(pa => pa.UnknownCitizenData);
            loadOptions.LoadWith <PersonAttributes>(pa => pa.HealthInformation);

            PersonProperties.SetChildLoadOptions(loadOptions);
            CprData.SetChildLoadOptions(loadOptions);
            ForeignCitizenData.SetChildLoadOptions(loadOptions);
        }
コード例 #3
0
        public static PersonAttributes[] FromXmlType(Schemas.Part.AttributListeType oio)
        {
            var ret = new List <PersonAttributes>();

            if (oio != null)
            {
                ret.AddRange(PersonProperties.FromXmlType(oio.Egenskab));
                ret.AddRange(CprData.FromXmlType(oio.RegisterOplysning));
                ret.AddRange(ForeignCitizenData.FromXmlType(oio.RegisterOplysning));
                ret.AddRange(UnknownCitizenData.FromXmlType(oio.RegisterOplysning));
                ret.AddRange(HealthInformation.FromXmlType(oio.SundhedOplysning));
            }
            return(ret.ToArray());
        }
コード例 #4
0
 /// <summary>
 /// Represents the ForeignCitizenData table
 /// </summary>
 public static UdenlandskBorgerType ToXmlType(ForeignCitizenData db)
 {
     if (db != null)
     {
         return(new UdenlandskBorgerType()
         {
             FoedselslandKode = CountryRef.ToXmlType(db.BirthCountryRef),
             PersonCivilRegistrationReplacementIdentifier = db.CivilRegistrationReplacementIdentifier,
             PersonIdentifikator = db.PersonIdentifier,
             SprogKode = ForeignCitizenCountry.ToXmlType(db.ForeignCitizenCountries, false),
             PersonNationalityCode = ForeignCitizenCountry.ToXmlType(db.ForeignCitizenCountries, true),
         });
     }
     return(null);
 }
コード例 #5
0
        public static ForeignCitizenData FromXmlType(UdenlandskBorgerType oio)
        {
            if (oio != null)
            {
                var ret = new ForeignCitizenData()
                {
                    BirthCountryRef = CountryRef.FromXmlType(oio.FoedselslandKode),
                    CivilRegistrationReplacementIdentifier = oio.PersonCivilRegistrationReplacementIdentifier,
                    PersonIdentifier = oio.PersonIdentifikator,
                };

                ret.ForeignCitizenCountries.AddRange(ForeignCitizenCountry.FromXmlType(oio.SprogKode, false));
                ret.ForeignCitizenCountries.AddRange(ForeignCitizenCountry.FromXmlType(oio.PersonNationalityCode, true));

                return(ret);
            }
            return(null);
        }