Esempio n. 1
0
        private AnalysisProcessingXCategoryValue XCategoryForRow(ICrmDataSourceRow row)
        {
            AnalysisCategoryValue categoryValue = this.Settings.XCategory?.CategoryValueForRow(row);

            if (categoryValue == null)
            {
                return(null);
            }
            else
            {
                var xcategory = this.xCategories.ValueOrDefault(categoryValue.Key);
                if (xcategory == null)
                {
                    xcategory = new AnalysisProcessingXCategoryValue(this, categoryValue);
                    if (this.xCategories == null)
                    {
                        this.xCategories = new Dictionary <string, AnalysisProcessingXCategoryValue> {
                            { xcategory.Key, xcategory }
                        };
                        this.xCategoryArray = new List <AnalysisProcessingXCategoryValue> {
                            xcategory
                        };
                    }
                    else
                    {
                        this.xCategories.SetObjectForKey(xcategory, xcategory.Key);
                        this.xCategoryArray.Add(xcategory);
                    }
                }

                return(xcategory);
            }
        }
        /// <summary>
        /// Add row x category
        /// </summary>
        /// <param name="row">Row</param>
        /// <param name="xCategoryValue">X category value</param>
        /// <returns>Returns add row x category</returns>
        public bool AddRowXCategory(ICrmDataSourceRow row, AnalysisProcessingXCategoryValue xCategoryValue)
        {
            bool complete = true;

            foreach (AnalysisProcessingResultColumnValue processingResultColumnValue in this.resultColumns)
            {
                if (!processingResultColumnValue.ApplyRowXCategoryValueSumLine(row, xCategoryValue, this.IsSumLine))
                {
                    complete = false;
                }
            }

            if (this.resultRows == null)
            {
                this.resultRows = new List <object> {
                    row
                };
            }
            else
            {
                this.resultRows.Add(row);
            }

            return(complete);
        }
Esempio n. 3
0
        private List <object> XCategoriesForRow(ICrmDataSourceRow row)
        {
            List <object> categoryValues = this.Settings.XCategory.CategoriesForRow(row);

            if (categoryValues.Count == 0)
            {
                return(null);
            }

            List <object> apCategoryValues = new List <object>();

            foreach (AnalysisCategoryValue categoryValue in categoryValues)
            {
                var xcategory = this.xCategories.ValueOrDefault(categoryValue.Key);
                if (xcategory == null)
                {
                    xcategory = new AnalysisProcessingXCategoryValue(this, categoryValue);
                    if (this.xCategories == null)
                    {
                        this.xCategories = new Dictionary <string, AnalysisProcessingXCategoryValue> {
                            { xcategory.Key, xcategory }
                        };
                        this.xCategoryArray = new List <AnalysisProcessingXCategoryValue> {
                            xcategory
                        };
                    }
                    else
                    {
                        this.xCategories.SetObjectForKey(xcategory, xcategory.Key);
                        this.xCategoryArray.Add(xcategory);
                    }
                }

                apCategoryValues.Add(xcategory);
            }

            return(apCategoryValues);
        }
Esempio n. 4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AnalysisProcessingQueryResultRowExecutionContext"/> class.
 /// </summary>
 /// <param name="dataSource">Data source</param>
 /// <param name="yCategoryValue">Y category value</param>
 /// <param name="xCategoryValue">X category value</param>
 /// <param name="processingContext">Processing context</param>
 public AnalysisProcessingQueryResultRowExecutionContext(ICrmDataSourceRow dataSource, AnalysisProcessingYCategoryValue yCategoryValue, AnalysisProcessingXCategoryValue xCategoryValue, AnalysisProcessing processingContext)
 {
     this.Row               = dataSource;
     this.YCategoryValue    = yCategoryValue;
     this.XCategoryValue    = xCategoryValue;
     this.ProcessingContext = processingContext;
 }
 /// <summary>
 /// Applies row x category value array
 /// </summary>
 /// <param name="dataSourceRow">Data source row</param>
 /// <param name="xCategoryValue">X Category value array</param>
 /// <param name="sumLine">Sum line</param>
 /// <returns>Boolean value for result</returns>
 public bool ApplyRowXCategoryValueSumLine(ICrmDataSourceRow dataSourceRow, AnalysisProcessingXCategoryValue xCategoryValue, bool sumLine)
 {
     return(this.ApplyRowXCategoryValueArraySumLine(dataSourceRow, xCategoryValue != null ? new List <object> {
         xCategoryValue
     } : null, sumLine));
 }