示例#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>
 /// Initializes a new instance of the <see cref="AnalysisProcessingYCategoryValue"/> class.
 /// </summary>
 /// <param name="processing">Processing</param>
 /// <param name="category">Category</param>
 public AnalysisProcessingYCategoryValue(AnalysisProcessing processing, AnalysisCategoryValue category)
     : base(processing, category)
 {
     this.resultColumns = new List <AnalysisProcessingResultColumnValue>();
     foreach (AnalysisProcessingResultColumn resultColumn in this.Processing.ResultColumns)
     {
         var processingResultColumnValue = AnalysisProcessingResultColumnValue.ColumnValueForAPResultColumnYCategory(resultColumn, this);
         if (processingResultColumnValue != null)
         {
             this.resultColumns.Add(processingResultColumnValue);
         }
     }
 }
示例#3
0
        private AnalysisProcessingYCategoryValue YCategoryForRow(ICrmDataSourceRow row)
        {
            AnalysisCategoryValue categoryValue = this.Settings.Category.CategoryValueForRow(row);

            if (categoryValue == null || categoryValue.Key.Length == 0)
            {
                if (this.Settings.ShowEmpty)
                {
                    categoryValue = this.Settings.Category.EmptyValue();
                }
                else
                {
                    return(null);
                }
            }

            var ycategory = this.yCategories.ValueOrDefault(categoryValue.Key);

            if (ycategory == null)
            {
                ycategory = new AnalysisProcessingYCategoryValue(this, categoryValue);
                if (this.yCategories == null)
                {
                    this.yCategories = new Dictionary <string, AnalysisProcessingYCategoryValue> {
                        { ycategory.Key, ycategory }
                    };
                    this.yCategoryArray = new List <AnalysisProcessingYCategoryValue> {
                        ycategory
                    };
                }
                else
                {
                    this.yCategories.SetObjectForKey(ycategory, ycategory.Key);
                    this.yCategoryArray.Add(ycategory);
                }
            }

            return(ycategory);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="AnalysisProcessingXCategoryValue"/> class.
 /// </summary>
 /// <param name="processing">Processing</param>
 /// <param name="category">Category</param>
 public AnalysisProcessingXCategoryValue(AnalysisProcessing processing, AnalysisCategoryValue category)
     : base(processing, category)
 {
 }
示例#5
0
        private List <object> YCategoriesForRow(ICrmDataSourceRow row)
        {
            List <object> categoryValues = this.Settings.Category.CategoriesForRow(row);

            if (categoryValues.Count == 0)
            {
                if (!this.Settings.ShowEmpty)
                {
                    return(null);
                }

                AnalysisCategoryValue emptyValue = this.Settings.Category.EmptyValue();
                if (emptyValue != null)
                {
                    categoryValues = new List <object> {
                        emptyValue
                    };
                }
            }

            if (categoryValues.Count == 1)
            {
                var v = categoryValues[0] as AnalysisProcessingYCategoryValue;
                if (v.Key.Length == 0)
                {
                    if (!this.Settings.ShowEmpty)
                    {
                        return(null);
                    }
                }
            }

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

            foreach (AnalysisCategoryValue categoryValue in categoryValues)
            {
                var ycategory = this.yCategories.ValueOrDefault(categoryValue.Key);
                if (ycategory == null)
                {
                    ycategory = new AnalysisProcessingYCategoryValue(this, categoryValue);
                    if (this.yCategories == null)
                    {
                        this.yCategories = new Dictionary <string, AnalysisProcessingYCategoryValue> {
                            { ycategory.Key, ycategory }
                        };
                        this.yCategoryArray = new List <AnalysisProcessingYCategoryValue> {
                            ycategory
                        };
                    }
                    else
                    {
                        this.yCategories.SetObjectForKey(ycategory, ycategory.Key);
                        this.yCategoryArray.Add(ycategory);
                    }
                }

                apCategoryValues.Add(ycategory);
            }

            if (apCategoryValues.Count == 0 && this.Settings.ShowEmpty)
            {
                AnalysisCategoryValue emptyValue = this.Settings.Category.EmptyValue();
                if (emptyValue != null)
                {
                    return(new List <object> {
                        emptyValue
                    });
                }
            }

            return(apCategoryValues);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="AnalysisProcessingCategoryValue"/> class.
 /// </summary>
 /// <param name="processing">Processing</param>
 /// <param name="category">Category</param>
 public AnalysisProcessingCategoryValue(AnalysisProcessing processing, AnalysisCategoryValue category)
 {
     this.Category   = category;
     this.Processing = processing;
     this.IsSumLine  = false;
 }