Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            //// only the first time

            // FromMySqlNeverAgain();
            Database.SetInitializer(new MigrateDatabaseToLatestVersion <SupermarketContext, Configuration>());

            /// run separately or it will be slow :)

            //Zipper.UnzipFiles();
            //ExcelReader.ReadExcelData();
            //Application.EnableVisualStyles();
            //Application.SetCompatibleTextRenderingDefault(false);
            //Application.Run(new Form1());


            var dbCobntext = new SupermarketContext();


            XmlReport.GenerateXml("../../../../GeneratedReports/xmlSales.xml");

            JsonReport jsonReport = new JsonReport(dbCobntext);

            jsonReport.GetProductsReport(@"../../../../GeneratedReports/productsReport.json");
            jsonReport.GenerateJsonFilesForEachProduct(@"../../../../GeneratedReports/ProductReportsForMongo/");
            MongoDbProvider.AddProducts(jsonReport);
            var ProductsFRomMongo = MongoDbProvider.MongoDBCollectionToList();

            ExcelReport excelReport = new ExcelReport(dbCobntext);

            excelReport.GenerateVendorTotalReport("n", ProductsFRomMongo);

            var vendorExpenses = ReadXML.ReadFileXML("../../../../Reports/Vendors-Expenses.xml");

            MongoDbProvider.AddVendorExpenses(vendorExpenses);


            Console.WriteLine();
        }