Beispiel #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AnalysisMetaInfoFieldInfo"/> class.
 /// </summary>
 /// <param name="tableInfo">Table info</param>
 /// <param name="dataSourceField">Data source field</param>
 /// <param name="fieldIndex">Field index</param>
 public AnalysisMetaInfoFieldInfo(AnalysisMetaInfoTableInfo tableInfo, ICrmDataSourceField dataSourceField, int fieldIndex)
 {
     this.DataSourceField = dataSourceField;
     this.FieldIndex      = fieldIndex;
     this.TableInfo       = tableInfo;
     this.subFieldArray   = null;
 }
Beispiel #2
0
        /// <summary>
        /// Build From Configuration
        /// </summary>
        public void BuildFromConfiguration()
        {
            this.IntializeBuild();

            for (var index = 0; index < this.resultInfoAreaCount; index++)
            {
                var table            = this.dataSourceMetaInfo.ResultTableAtIndex(index);
                var infoAreaId       = table.InfoAreaId;
                var infoAreaIdTables = this.tablesPerInfoAreaId.ValueOrDefault(infoAreaId) as List <object>;
                if (infoAreaIdTables == null)
                {
                    infoAreaIdTables = new List <object>();
                    this.occurrence  = 0;
                    this.tablesPerInfoAreaId.SetObjectForKey(infoAreaIdTables, infoAreaId);
                }
                else
                {
                    this.occurrence = infoAreaIdTables.Count;
                }

                var tableInfo =
                    new AnalysisMetaInfoTableInfo(table, this.tableIndex++, this.fieldIndex, this.occurrence);
                infoAreaIdTables.Add(tableInfo);
                this.tablesForKey.SetObjectForKey(tableInfo, tableInfo.Key);
                this.fieldIndex += table.NumberOfFields();
            }

            this.ProcessConfigurationTable();

            foreach (AnalysisSourceField analysisSourceField in this.sourceFields)
            {
                if (analysisSourceField.IsResultColumn)
                {
                    var resultColumn = new AnalysisSourceFieldResultColumn(analysisSourceField);
                    this.resultColumns.SetObjectForKey(resultColumn, resultColumn.AnalysisField.Key);
                }
            }

            if (this.Analysis.DefaultCategory == null && this.firstCategory != null)
            {
                this.SetDefaultCategory(this.firstCategory);
            }

            this.SetTableDictionaryByKey(this.tableDictByKey);
            this.SetTableDictionaryByIndex(this.tableDictByIndex);
            this.SetFieldDictionary(this.fieldDict);
            this.SetCategoryDictionary(this.categoryDictionary);
            this.SetSourceFieldArray(this.sourceFields);

            this.ProcessingAnalysisConfiguration();

            this.SetResultColumnDictionary(this.resultColumns);
            this.SetValueDictionary(this.valueDictionary);
            this.SetFilters(this.filters);
            if (this.hasCurrencyField)
            {
                this.SetCurrencyConversion(CurrencyConversion.DefaultConversion);
            }
        }
Beispiel #3
0
 /// <summary>
 /// Gets key for table field id
 /// </summary>
 /// <param name="tableInfo">Table infp</param>
 /// <param name="fieldId">Field info</param>
 /// <returns>Field id</returns>
 public static string KeyForTableFieldId(AnalysisMetaInfoTableInfo tableInfo, int fieldId)
 {
     return($"{tableInfo.Key}.{(long)fieldId}");
 }