Example #1
0
        internal void AddAddressReferences(List <AddressRelation> references, VirkningType virkning, RegistreringType1 registration)
        {
            if (references == null || references.Count == 0)
            {
                return;
            }

            var adresses = new AdresseFlerRelationType[references.Count];

            int referencesCount = references.Count;

            registration.RelationListe.Adresser = new AdresseFlerRelationType[referencesCount];

            for (int i = 0; i < referencesCount; i++)
            {
                AddressRelation addressRelation = references[i];

                switch (addressRelation.Type)
                {
                case AddressRelationType.URL:
                    AdresseFlerRelationType urlAddress = CreateAddressReference(addressRelation.Uuid, (i + 1), UUIDConstants.ADDRESS_ROLE_ORGFUNCTION_URL, virkning);
                    registration.RelationListe.Adresser[i] = urlAddress;
                    break;

                default:
                    throw new Exception("Cannot import OrganisationFunktion with addressRelationType = " + addressRelation.Type);
                }
            }
        }
Example #2
0
        internal void AddAddressReferences(List <AddressRelation> references, VirkningType virkning, RegistreringType1 registration)
        {
            if (references == null || references.Count == 0)
            {
                return;
            }

            var adresses = new AdresseFlerRelationType[references.Count];

            int referencesCount = references.Count;

            registration.RelationListe.Adresser = new AdresseFlerRelationType[referencesCount];

            for (int i = 0; i < referencesCount; i++)
            {
                AddressRelation addressRelation = references[i];

                switch (addressRelation.Type)
                {
                case AddressRelationType.EMAIL:
                    AdresseFlerRelationType emailAddress = CreateAddressReference(addressRelation.Uuid, (i + 1), UUIDConstants.ADDRESS_ROLE_USER_EMAIL, virkning);
                    registration.RelationListe.Adresser[i] = emailAddress;
                    break;

                case AddressRelationType.RACFID:
                    AdresseFlerRelationType racfId = CreateAddressReference(addressRelation.Uuid, (i + 1), UUIDConstants.ADDRESS_ROLE_USER_RACFID, virkning);
                    registration.RelationListe.Adresser[i] = racfId;
                    break;

                case AddressRelationType.PHONE:
                    AdresseFlerRelationType phoneAddress = CreateAddressReference(addressRelation.Uuid, (i + 1), UUIDConstants.ADDRESS_ROLE_USER_PHONE, virkning);
                    registration.RelationListe.Adresser[i] = phoneAddress;
                    break;

                case AddressRelationType.LOCATION:
                    AdresseFlerRelationType locationAddres = CreateAddressReference(addressRelation.Uuid, (i + 1), UUIDConstants.ADDRESS_ROLE_USER_LOCATION, virkning);
                    registration.RelationListe.Adresser[i] = locationAddres;
                    break;

                default:
                    throw new Exception("Cannot import Bruger with addressRelationType = " + addressRelation.Type);
                }
            }
        }
        internal void AddAddressReferences(List <AddressRelation> references, VirkningType virkning, RegistreringType1 registration)
        {
            if (references == null || references.Count == 0)
            {
                return;
            }

            var adresses = new AdresseFlerRelationType[references.Count];

            int referencesCount = references.Count;

            registration.RelationListe.Adresser = new AdresseFlerRelationType[referencesCount];

            for (int i = 0; i < referencesCount; i++)
            {
                AddressRelation addressRelation = references[i];

                switch (addressRelation.Type)
                {
                case AddressRelationType.EMAIL:
                    AdresseFlerRelationType emailAddress = CreateAddressReference(addressRelation.Uuid, (i + 1), UUIDConstants.ADDRESS_ROLE_ORGUNIT_EMAIL, virkning);
                    registration.RelationListe.Adresser[i] = emailAddress;
                    break;

                case AddressRelationType.PHONE:
                    AdresseFlerRelationType phoneAddress = CreateAddressReference(addressRelation.Uuid, (i + 1), UUIDConstants.ADDRESS_ROLE_ORGUNIT_PHONE, virkning);
                    registration.RelationListe.Adresser[i] = phoneAddress;
                    break;

                case AddressRelationType.LOCATION:
                    AdresseFlerRelationType locationAddres = CreateAddressReference(addressRelation.Uuid, (i + 1), UUIDConstants.ADDRESS_ROLE_ORGUNIT_LOCATION, virkning);
                    registration.RelationListe.Adresser[i] = locationAddres;
                    break;

                case AddressRelationType.LOSSHORTNAME:
                    AdresseFlerRelationType losAddress = CreateAddressReference(addressRelation.Uuid, (i + 1), UUIDConstants.ADDRESS_ROLE_ORGUNIT_LOSSHORTNAME, virkning);
                    registration.RelationListe.Adresser[i] = losAddress;
                    break;

                case AddressRelationType.CONTACT_ADDRESS_OPEN_HOURS:
                    AdresseFlerRelationType contactOpenHoursAddress = CreateAddressReference(addressRelation.Uuid, (i + 1), UUIDConstants.ADDRESS_ROLE_ORGUNIT_CONTACT_ADDRESS_OPEN_HOURS, virkning);
                    registration.RelationListe.Adresser[i] = contactOpenHoursAddress;
                    break;

                case AddressRelationType.DTR_ID:
                    AdresseFlerRelationType dtrId = CreateAddressReference(addressRelation.Uuid, (i + 1), UUIDConstants.ADDRESS_ROLE_ORGUNIT_DTR_ID, virkning);
                    registration.RelationListe.Adresser[i] = dtrId;
                    break;

                case AddressRelationType.URL:
                    AdresseFlerRelationType urlAddress = CreateAddressReference(addressRelation.Uuid, (i + 1), UUIDConstants.ADDRESS_ROLE_ORGUNIT_URL, virkning);
                    registration.RelationListe.Adresser[i] = urlAddress;
                    break;

                case AddressRelationType.LANDLINE:
                    AdresseFlerRelationType landlineAddress = CreateAddressReference(addressRelation.Uuid, (i + 1), UUIDConstants.ADDRESS_ROLE_ORGUNIT_LANDLINE, virkning);
                    registration.RelationListe.Adresser[i] = landlineAddress;
                    break;

                case AddressRelationType.EAN:
                    AdresseFlerRelationType eanAddress = CreateAddressReference(addressRelation.Uuid, (i + 1), UUIDConstants.ADDRESS_ROLE_ORGUNIT_EAN, virkning);
                    registration.RelationListe.Adresser[i] = eanAddress;
                    break;

                case AddressRelationType.LOSID:
                    AdresseFlerRelationType losIdAddress = CreateAddressReference(addressRelation.Uuid, (i + 1), UUIDConstants.ADDRESS_ROLE_ORGUNIT_LOSID, virkning);
                    registration.RelationListe.Adresser[i] = losIdAddress;
                    break;

                case AddressRelationType.PHONE_OPEN_HOURS:
                    AdresseFlerRelationType phoneOpenHoursAddress = CreateAddressReference(addressRelation.Uuid, (i + 1), UUIDConstants.ADDRESS_ROLE_ORGUNIT_PHONE_OPEN_HOURS, virkning);
                    registration.RelationListe.Adresser[i] = phoneOpenHoursAddress;
                    break;

                case AddressRelationType.POST:
                    AdresseFlerRelationType postAddress = CreateAddressReference(addressRelation.Uuid, (i + 1), UUIDConstants.ADDRESS_ROLE_ORGUNIT_POST, virkning);
                    registration.RelationListe.Adresser[i] = postAddress;
                    break;

                case AddressRelationType.CONTACT_ADDRESS:
                    AdresseFlerRelationType contactAddress = CreateAddressReference(addressRelation.Uuid, (i + 1), UUIDConstants.ADDRESS_ROLE_ORGUNIT_CONTACT_ADDRESS, virkning);
                    registration.RelationListe.Adresser[i] = contactAddress;
                    break;

                case AddressRelationType.EMAIL_REMARKS:
                    AdresseFlerRelationType emailRemarks = CreateAddressReference(addressRelation.Uuid, (i + 1), UUIDConstants.ADDRESS_ROLE_ORGUNIT_EMAIL_REMARKS, virkning);
                    registration.RelationListe.Adresser[i] = emailRemarks;
                    break;

                case AddressRelationType.POST_RETURN:
                    AdresseFlerRelationType postReturn = CreateAddressReference(addressRelation.Uuid, (i + 1), UUIDConstants.ADDRESS_ROLE_ORGUNIT_POST_RETURN, virkning);
                    registration.RelationListe.Adresser[i] = postReturn;
                    break;

                default:
                    throw new Exception("Cannot import OrganisationEnhed with addressRelationType = " + addressRelation.Type);
                }
            }
        }