// Warning - will not work - see comment above ProblemFour method invokation in Main() public static void Main() { var mongoHandler = new MongoDbHandler(); var sqlHandler = new SqlServerHandler(); var mySqlHandler = new MySqlHandler(); var pdfHandler = new PdfHandler(); var xmlToSql = new XmlToSqlServerLoader(); var excellHandler = new ExcellHandler(); var mongoToSql = new MongoToSqlServerLoader(); var zipExtractor = new ZipExtractor(); var jsonHandler = new JsonHandler(); var sqliteHandler = new SqliteHandler(); var xmlHandler = new XmlHandler(); if (!Directory.Exists(OutputDirectory)) { Directory.CreateDirectory(OutputDirectory); } //// Mongolab.com credentials - Username: TeamXenon , Passsword: xenon123 ProblemOne(mongoHandler, mongoToSql, zipExtractor, excellHandler); ProblemTwo(pdfHandler); ProblemThree(xmlHandler); //// NOTE!!! - you need to go to CarParts.Data.MySql project and in its App.config file //// you should change the password in the connectionString tag with which you connect to your localhost instance of the MySQL Workbench server. ProblemFour(sqlHandler, mySqlHandler, jsonHandler); ProblemFive(mongoHandler, xmlToSql); ProblemSix(excellHandler, sqlHandler, sqliteHandler, mySqlHandler); }
private static void ProblemFour(SqlServerHandler sqlHandler, MySqlHandler mySqlHandler, JsonHandler jsonHandler) { var reports = sqlHandler.ReadPartReports(); jsonHandler.GenerateJsonReports(reports); mySqlHandler.WriteReports(reports); Console.WriteLine("Successfully added json reports to the file system and to MySQL database."); }
private static void ProblemSix(ExcellHandler excellHandler, SqlServerHandler sqlHandler, SqliteHandler sqliteHandler, MySqlHandler mySqlHandler) { var reports = mySqlHandler.ReadReports(); var taxes = sqliteHandler.ReadTaxes(); excellHandler.GenerateExcellFile(reports, taxes, "VendorsFinancialReport.xlsx"); Console.WriteLine("Successfully generated excell file to "); }