예제 #1
0
        static void Main(string[] args)
        {
            TextWriterModule writer = new TextWriterModule();

            writer.Context = Console.Out;
            writer.Write(GetWelcomeMessage());

            NewDatabaseEntities database = new NewDatabaseEntities();

            ReportDataModule dataProcessor = new ReportDataModule();

            dataProcessor.Context = database;
            List <Item> items = dataProcessor.Read();

            ReportWriter reportWriter = new ReportWriter();

            reportWriter.Context = Console.Out;
            reportWriter.Write(items);

            int count = database.Items.Count();

            writer.Write(Environment.NewLine);

            writer.Write(String.Format("\nItems scanned: {0}", count), Environment.NewLine);

            Console.ReadKey();
        }
예제 #2
0
        private static void PrintReportToScreen(List <Item> list)
        {
            IDataWriter <IEnumerable <Item> > report = new ReportWriter(Console.Out);

            report.Write(list);
        }