Exemple #1
0
        static void Main()
        {
            LoggerTests();
            CategoriesRefiller();


            var dataCollector = new StatsDataCollector();
            var data          = dataCollector.CollectMonthlyStats();

            _ = true;


            var positions = data.Costs
                            .OrderByDescending(o => o.Amount)
                            .GroupBy(x => new { x.FullName, x.Amount })
                            .Select(y => new
            {
                Category = y.Select(q => q.Category).First(),
                Name     = y.Select(q => q.Name).First(),
                FullName = y.Select(q => q.FullName).First(),
                Cost     = y.Key.Amount,
                Poss     = y.Count(),
                Total    = y.Sum(q => q.Amount)
            })
                            .ToList();
        }
        protected override ReportDto GetReportData()
        {
            Logger.Log("Monthly report is building ...");

            var dailyData = _statsDataCollector.CollectMonthlyStats();

            if (dailyData == null)
            {
                Logger.Log("No monthly costs.");
                return(null);
            }

            return(dailyData);
        }