コード例 #1
0
        private List <DataSourceModelFieldMeta> ProcessFieldsMeta(List <EqlFieldMeta> fields)
        {
            List <DataSourceModelFieldMeta> result = new List <DataSourceModelFieldMeta>();

            if (fields == null)
            {
                return(result);
            }

            foreach (var fieldMeta in fields)
            {
                DataSourceModelFieldMeta dsMeta = new DataSourceModelFieldMeta();
                dsMeta.EntityName = string.Empty;
                if (fieldMeta.Relation != null)
                {
                    dsMeta.Name = "$" + fieldMeta.Relation.Name;
                    dsMeta.Type = FieldType.RelationField;
                }
                if (fieldMeta.Field != null)
                {
                    dsMeta.Name = fieldMeta.Field.Name;
                    dsMeta.Type = fieldMeta.Field.GetFieldType();
                }

                dsMeta.Children.AddRange(ProcessFieldsMeta(fieldMeta.Children));
                result.Add(dsMeta);
            }

            return(result);
        }
コード例 #2
0
        public EntityRecordListToSelectOptionConverter() : base()
        {
            Id          = new Guid("12dcdf08-af03-4347-8015-bd9bace17514");
            Name        = "EntityRecordToSelectOptions";
            Description = "Mapper for EntityRecord to SelectOption";
            ResultModel = "List<SelectOption>";

            //define custom meta
            DataSourceModelFieldMeta dsMeta = new DataSourceModelFieldMeta();

            dsMeta.EntityName = string.Empty;
            dsMeta.Name       = "value";
            dsMeta.Type       = FieldType.TextField;
            Fields.Add(dsMeta);
            dsMeta            = new DataSourceModelFieldMeta();
            dsMeta.EntityName = string.Empty;
            dsMeta.Name       = "label";
            dsMeta.Type       = FieldType.TextField;
            Fields.Add(dsMeta);
            dsMeta            = new DataSourceModelFieldMeta();
            dsMeta.EntityName = string.Empty;
            dsMeta.Name       = "icon_class";
            dsMeta.Type       = FieldType.TextField;
            Fields.Add(dsMeta);
            dsMeta            = new DataSourceModelFieldMeta();
            dsMeta.EntityName = string.Empty;
            dsMeta.Name       = "color";
            dsMeta.Type       = FieldType.TextField;
            Fields.Add(dsMeta);


            Parameters.Add(new DataSourceParameter {
                Name = "DataSourceName", Type = "text", Value = ""
            });
            Parameters.Add(new DataSourceParameter {
                Name = "KeyPropName", Type = "text", Value = "id"
            });
            Parameters.Add(new DataSourceParameter {
                Name = "ValuePropName", Type = "text", Value = "label"
            });
            Parameters.Add(new DataSourceParameter {
                Name = "Value1PropName", Type = "text", Value = "label1"
            });
            Parameters.Add(new DataSourceParameter {
                Name = "Value2PropName", Type = "text", Value = "label2"
            });
            Parameters.Add(new DataSourceParameter {
                Name = "IconClassPropName", Type = "text", Value = "icon_class"
            });
            Parameters.Add(new DataSourceParameter {
                Name = "ColorPropName", Type = "text", Value = "color"
            });
            Parameters.Add(new DataSourceParameter {
                Name = "SortOrderPropName", Type = "text", Value = ""
            });
            Parameters.Add(new DataSourceParameter {
                Name = "SortTypePropName", Type = "text", Value = "asc"
            });
        }