예제 #1
0
 private static bool HasContactData(MetadataEntityInformationUnit entityInformationUnit)
 {
     return(!string.IsNullOrEmpty(entityInformationUnit.ContactPerson) ||
            !string.IsNullOrEmpty(entityInformationUnit.Address) ||
            !string.IsNullOrEmpty(entityInformationUnit.Telephone) ||
            !string.IsNullOrEmpty(entityInformationUnit.Email));
 }
예제 #2
0
 private static GuiMetaDataModel MapToGuiMetadataEntity(
     MetadataEntityInformationUnit metadataEntityInformationUnit)
 {
     return(new GuiMetaDataModel(
                metadataEntityInformationUnit.Entity,
                metadataEntityInformationUnit.ContactPerson,
                metadataEntityInformationUnit.Telephone,
                metadataEntityInformationUnit.Email
                ));
 }
예제 #3
0
        private static void LoadEntityInformationUnits(List <MetadataEntityInformationUnit> entityInfoUnits,
                                                       metsTypeMetsHdrAgent[] metsEntityAgents)
        {
            MetadataEntityInformationUnit entityInfoUnit = null;

            foreach (metsTypeMetsHdrAgent metsEntityAgent in metsEntityAgents)
            {
                if (metsEntityAgent.TYPE == metsTypeMetsHdrAgentTYPE.ORGANIZATION)
                {
                    entityInfoUnit = new MetadataEntityInformationUnit {
                        Entity = metsEntityAgent.name
                    };
                    entityInfoUnits.Add(entityInfoUnit);
                }

                // Attaches contact info to last seen organization:
                if (metsEntityAgent.TYPE == metsTypeMetsHdrAgentTYPE.INDIVIDUAL && entityInfoUnit != null)
                {
                    if (!string.IsNullOrEmpty(metsEntityAgent.name))
                    {
                        entityInfoUnit.ContactPerson = metsEntityAgent.name;
                    }

                    string address = metsEntityAgent.note?.FirstOrDefault(LooksLikeAddress);

                    if (!string.IsNullOrEmpty(address))
                    {
                        entityInfoUnit.Address = address;
                    }

                    string phoneNumber = metsEntityAgent.note?.FirstOrDefault(LooksLikePhoneNumber);

                    if (!string.IsNullOrEmpty(phoneNumber))
                    {
                        entityInfoUnit.Telephone = phoneNumber;
                    }

                    string emailAddress = metsEntityAgent.note?.FirstOrDefault(LooksLikeEmailAddress);

                    if (!string.IsNullOrEmpty(emailAddress))
                    {
                        entityInfoUnit.Email = emailAddress;
                    }
                }
            }
        }
예제 #4
0
 public static GuiMetaDataModel MapToProducer(MetadataEntityInformationUnit producer)
 {
     return(MapToGuiMetadataEntity(producer));
 }
예제 #5
0
 public static GuiMetaDataModel MapToTransferer(MetadataEntityInformationUnit transferrer)
 {
     return(MapToGuiMetadataEntity(transferrer));
 }
예제 #6
0
 private static bool HasEntity(MetadataEntityInformationUnit entityInformationUnit)
 {
     return(!string.IsNullOrEmpty(entityInformationUnit.Entity));
 }
예제 #7
0
 public static GuiMetaDataModel MapToCreator(MetadataEntityInformationUnit creator)
 {
     return(MapToGuiMetadataEntity(creator));
 }