Beispiel #1
0
        private async Task <BaseReport> GetBaseReport(ElementType type, DateTime from, DateTime to, int entityId, string groupBy)
        {
            var periodReport = await _reportService.GetPeriodReportAsync(type, from, to, entityId);

            var chart = ChartService.ElementDiffToBarChart(
                await _reportService.GroupByDateAsync(periodReport, groupBy));

            var entities = new List <KeyValuePair <int, string> >()
            {
                new KeyValuePair <int, string>(-1, "Все")
            };

            entities.AddRange(type switch
            {
                ElementType.Montage => await _montageService.GetListForSelectAsync(),
                ElementType.Design => await _designService.GetListForSelectAsync(),
                ElementType.Device => await _deviceService.GetListForSelectAsync(),
                _ => new List <KeyValuePair <int, string> >(),
            });