Exemplo n.º 1
0
        public static void Task1()
        {
            //Button - Create Database
            Database.SetInitializer(new MigrateDatabaseToLatestVersion <ComputersFactoryContext, Configuration>());

            var context = new ComputersFactoryContext();

            context.Database.CreateIfNotExists();

            //Button - Extract from Zip
            ZipHanlder.ExtractExcelFiles(@"..\..\..\..\Excel\Excel.zip");

            //Button - Load Data from MongoDB to MSSQL
            var mongo = new MongoDBHanlder("ScrewdriverDB");

            mongo.TransferToMSSQL().Wait();

            //Button - Load data from Excel to MSSQL
            ExcelHandler.TransferAllData();
        }
 private void button1_Click(object sender, RoutedEventArgs e)
 {
     ZipHanlder.ExtractExcelFiles(filePath);
 }