Example #1
0
        private string GetColumnValue(AryaDbDataContext dc, SchemaInfo schema, string columnName)
        {
            var value = string.Empty;

            if (_taxColumns.Contains(columnName))
            {
                value = GetColumnValue(schema.TaxonomyInfo, columnName);
            }
            else if (String.CompareOrdinal("Attribute", columnName) == 0)
            {
                value = schema.Attribute.AttributeName;
            }
            else
            {
                value = SchemaAttribute.GetMetaAttributeValue(schema.Attribute,
                                                              Attribute.GetAttributeFromName(CurrentDb, columnName, false, AttributeTypeEnum.SchemaMeta),
                                                              schema.TaxonomyInfo);

                if (String.Compare(Resources.SchemaEnrichmentImageAttributeName, columnName,
                                   StringComparison.OrdinalIgnoreCase) == 0)
                {
                    var imageMgr = new ImageManager(dc, Args.ProjectId, value)
                    {
                        LocalDirectory  = ArgumentDirectoryPath,
                        RemoteImageGuid = value
                    };
                    //if (!Directory.Exists(imageMgr.LocalDirectory))
                    //    Directory.CreateDirectory(imageMgr.LocalDirectory);

                    if (Args.DownloadAssets)
                    {
                        imageMgr.DownloadImage(schema.TaxonomyInfo.ID, schema.Attribute.ID);
                    }

                    value = imageMgr.OriginalFileName;
                }
            }
            return(value);
        }