Пример #1
0
        public void ComputeTotals()
        {
            foreach (var item in CategoryGroups)
            {
                item.ComputeTotals();
            }

            var totals = new BigTableValue[Dates.Length];

            for (var i = 0; i < totals.Length; i++)
            {
                var sum = new BigTableValue();
                foreach (var item in CategoryGroups)
                {
                    sum += item.Totals[i];
                }

                totals[i] = sum;
            }

            Totals = totals;
            Total  = totals.Aggregate(new BigTableValue(), (acc, value) => acc + value);
        }
        public void ComputeTotals()
        {
            foreach (var item in Categories)
            {
                item.ComputeTotals();
            }

            var amounts = new BigTableValue[BigTable.Dates.Length];

            for (var i = 0; i < amounts.Length; i++)
            {
                var sum = new BigTableValue();
                foreach (var item in Categories)
                {
                    sum += item.Totals[i];
                }

                amounts[i] = sum;
            }

            Totals = amounts;
            _total = amounts.Aggregate(new BigTableValue(), (acc, value) => acc + value);
        }
Пример #3
0
 public BigTableCategory(BigTableCategoryGroup categoryGroup)
 {
     CategoryGroup = categoryGroup ?? throw new ArgumentNullException(nameof(categoryGroup));
     Totals        = new BigTableValue[categoryGroup.BigTable.Dates.Length];
 }
Пример #4
0
 public void ComputeTotals()
 {
     Total = Totals.Aggregate(new BigTableValue(), (acc, value) => acc + value);
 }