private static Action<ISummaryRepositoryItem, ISummaryRepositoryItem> CalculateAggregateAction(SummaryRepositoryItemsContext itemsContext)
        {
            var summaryType = itemsContext.ItemsSummaryType;

            switch (summaryType)
            {
                case DevExpress.Data.Filtering.Aggregate.Avg:
                    return AVGAggregateAction;
                case DevExpress.Data.Filtering.Aggregate.Count:
                    return COUNTAggregateAction;
                case DevExpress.Data.Filtering.Aggregate.Max:
                    return MAXAggregateAction;
                case DevExpress.Data.Filtering.Aggregate.Min:
                    return MINAggregateAction;
                case DevExpress.Data.Filtering.Aggregate.Sum:
                    return SUMAggregateAction;
                default:
                    throw new NotSupportedException("Не поддерживаем SummaryType отличный от 'Avg', 'Count', 'Min', 'Max', 'Sum'. Переданное значение SummaryType: '{0}'".FillWith(summaryType));
            }
        }
Example #2
0
        private static Action <ISummaryRepositoryItem, ISummaryRepositoryItem> CalculateAggregateAction(SummaryRepositoryItemsContext itemsContext)
        {
            var summaryType = itemsContext.ItemsSummaryType;

            switch (summaryType)
            {
            case DevExpress.Data.Filtering.Aggregate.Avg:
                return(AVGAggregateAction);

            case DevExpress.Data.Filtering.Aggregate.Count:
                return(COUNTAggregateAction);

            case DevExpress.Data.Filtering.Aggregate.Max:
                return(MAXAggregateAction);

            case DevExpress.Data.Filtering.Aggregate.Min:
                return(MINAggregateAction);

            case DevExpress.Data.Filtering.Aggregate.Sum:
                return(SUMAggregateAction);

            default:
                throw new NotSupportedException("Не поддерживаем SummaryType отличный от 'Avg', 'Count', 'Min', 'Max', 'Sum'. Переданное значение SummaryType: '{0}'".FillWith(summaryType));
            }
        }
Example #3
0
 private static ISummaryRepositoryItem CreateResultItem(SummaryRepositoryItemsContext itemsContext)
 {
     return((ISummaryRepositoryItem)Activator.CreateInstance(itemsContext.ItemsType, itemsContext.ItemsDescriptor));
 }
 private static ISummaryRepositoryItem CreateResultItem(SummaryRepositoryItemsContext itemsContext)
 {
     return (ISummaryRepositoryItem)Activator.CreateInstance(itemsContext.ItemsType, itemsContext.ItemsDescriptor);
 }