Beispiel #1
0
        public static List <ReportTemplateModel> GetAvailableReportTemplates(Enums.ReportType reportType, RayimContext _context)
        {
            var templates = _context.ReportTemplates
                            .Where(x => x.ReportType.Name == reportType.ToString())
                            .Select(x => new ReportTemplateModel {
                StartDate = x.StartDate, EndDate = x.EndDate, Description = x.Description
            }).ToList();

            templates.Insert(0, new ReportTemplateModel {
                Description = "Default"
            });

            return(templates);
        }
Beispiel #2
0
        public async Task <ActionResult> GetChartReport([FromQuery] int storeId, [FromQuery] string userName, [FromQuery] Enums.ReportType reportType)
        {
            var reportDto = new GetChartReportDto();

            reportDto.StoreId    = storeId;
            reportDto.ReportType = reportType;
            reportDto.UserName   = userName;

            var chartReport = await _storeRepository.GetChartReport(reportDto);

            return(Ok(chartReport));
        }