コード例 #1
0
        static void Main()
        {
            var entries = ReadPlPollutionDataEntries(out var airQualityDataPath,
                                                     out var excelDataReader);

            var reportGenerator = new ReportGenerator();

            GenerateCityWiseReport(entries, reportGenerator);

            // finally, generate report based on pollutants
            GeneratePollutantReport(entries, reportGenerator);
        }
コード例 #2
0
        private static void GenerateCityWiseReport(List <PollutionDataEntry> entries, ReportGenerator reportGenerator)
        {
            // now transform into the desired class structure for generating the city-wise entries
            // and generate the report
            var citywiseReportPath = ConfigurationManager.AppSettings["CitywiseReportPath"];
            var cityFormatter      = new CityWiseFormatter(entries);

            reportGenerator.Generate(cityFormatter, citywiseReportPath,
                                     "India Pollution Report - City-wise");
            Console.WriteLine($"CityWise Report generated at {citywiseReportPath}.");
        }
コード例 #3
0
        private static void GeneratePollutantReport(List <PollutionDataEntry> entries, ReportGenerator reportGenerator)
        {
            var pollutantReportPath = ConfigurationManager.AppSettings["PollutantReportPath"];
            var pollutantFormatter  = new PollutantWiseFormatter(entries);

            reportGenerator.Generate(pollutantFormatter, pollutantReportPath,
                                     "India Pollution Report - Pollutant - wise");
            Console.WriteLine($"PollutantWise Report generated at {pollutantReportPath}.");
        }