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(); }
void GeneratePdf(GameSession.Types types, int num_games, int gamespage, GameDifficulty difficulty, bool colorblind, string filename) { Game [] games; GameSession session; string msg; MessageType msg_type; games = new Game [num_games]; session = new GameSession(Translations); session.GameManager = manager; session.PlayList.ColorBlind = colorblind; session.PlayList.Difficulty = difficulty; session.PlayList.GameType = types; for (int n = 0; n < num_games; n++) { games [n] = session.PlayList.GetPuzzle(); games [n].Translations = Translations; } if (pdfExporter.GeneratePdf(games, gamespage, filename) == true) { msg = Catalog.GetString("The PDF file has been exported correctly."); msg_type = MessageType.Info; } else { msg = Catalog.GetString("There was a problem generating the PDF file. The file has not been created."); msg_type = MessageType.Error; } // Notify operation result MessageDialog md = new MessageDialog(this, DialogFlags.Modal, msg_type, ButtonsType.Ok, msg); md.Run(); md.Destroy(); }