public static void Main()
        {
            var db = new FurnitureFactoryDbContext();
            Utils.IUserInterfaceHandlerIO io = new ConsoleUserInterfaceIO();

            var mongodata = new MongoDbData(DatabaseName, io);
            mongodata.Import(db);

            // Task 1. Load excel from zip
            LoadSalesReports(SourceSalesReportsArchiveFilePath);

            new MaterialsXmlImporter().Import();
            new ProductionDetailsXmlImporter().Import();
            new RoomsXmlMongoImporter().Import(io);

            PdfExporter pdfExporter = new PdfExporter(db);
            pdfExporter.GeneratePdf();

            // Task 4.1
            var jsonReporter = new JsonProductsReporter(db);
            jsonReporter.GetJsonReport().Load();

            // Task 4.2
            //var mySqlImporter = new SalesReportsMySqlImporter(io);
            //mySqlImporter.Save();

            //// Task 3. Generate Xml Report in Xml-Exports folder
            var productXmlReport = new ProductsXmlFileExporter(db);
            productXmlReport.GetXmlReport();

            var ordersXmlReport = new OrdersXmlFileExporter(db);
            ordersXmlReport.GetXmlReport();
        }
Esempio n. 2
0
        public static void Main()
        {
            var db = new FurnitureFactoryDbContext();
            ConsoleUserInterfaceIO io = new ConsoleUserInterfaceIO();

            //db.Database.Delete();
            //db.Database.Create();

            //var mongodata = new MongoDbData(DatabaseName, io);
            //mongodata.Import(db);

            //PdfExporter pdfExporter = new PdfExporter(db);
            //pdfExporter.GeneratePdf();

            var furnituresForBedroom = db.Products
                                       .Where(x => x.RoomId == 1)
                                       .Select(x => x.Series.Name)
                                       .ToList();

            // Output must be: ALVIS \n  396    Tests, huh? :D

            io.SetOutput(furnituresForBedroom.FirstOrDefault());
            io.SetOutput(db.Products.Count());

            // task 4.1
            //var jsonReporter = new JsonProductsReporter(db);
            //jsonReporter.GetJsonReport().Load();

            // task 4.2
            //var mySqlImporter = new SalesReportsMySqlImporter(io);
            //mySqlImporter.Save();

            //// Generate Xml Report in Xml-Exports folder
            var productXmlReport = new ProductsXmlFileExporter(db);

            productXmlReport.GetXmlReport();

            var ordersXmlReport = new OrdersXmlFileExporter(db);

            ordersXmlReport.GetXmlReport();

            //// import XML file
            //var importProducts = new ProductsXmlFileImporter();
            //importProducts.ImportXmlData("../../../Xml-Data.xml");


            // Load excel from zip - Task1

            LoadSalesReports(SourceSalesReportsArchiveFilePath);
        }
Esempio n. 3
0
        public static void Main()
        {
            var db = new FurnitureFactoryDbContext();

            Utils.IUserInterfaceHandlerIO io = new ConsoleUserInterfaceIO();

            var mongodata = new MongoDbData(DatabaseName, io);

            mongodata.Import(db);

            // Task 1. Load excel from zip
            LoadSalesReports(SourceSalesReportsArchiveFilePath);

            new MaterialsXmlImporter().Import();
            new ProductionDetailsXmlImporter().Import();
            new RoomsXmlMongoImporter().Import(io);

            PdfExporter pdfExporter = new PdfExporter(db);

            pdfExporter.GeneratePdf();

            // Task 4.1
            var jsonReporter = new JsonProductsReporter(db);

            jsonReporter.GetJsonReport().Load();

            // Task 4.2
            //var mySqlImporter = new SalesReportsMySqlImporter(io);
            //mySqlImporter.Save();

            //// Task 3. Generate Xml Report in Xml-Exports folder
            var productXmlReport = new ProductsXmlFileExporter(db);

            productXmlReport.GetXmlReport();

            var ordersXmlReport = new OrdersXmlFileExporter(db);

            ordersXmlReport.GetXmlReport();
        }