コード例 #1
0
        private void Import(object sender)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();

            openFileDialog.Filter           = "Excel files (*.xls)|*.xls|(*.xlsx)|*.xlsx";
            openFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
            openFileDialog.ShowDialog();

            /*Fixtures.InstallFixtures();
             *
             * XLSLoader loader = new XLSLoader(openFileDialog.FileName);
             * var modules = loader.GetModules();
             * var groups = loader.GetGroups();
             * var msaDict = loader.GetModuleStudyActionsDict(modules, groups);
             *
             * loader.SaveStuff(modules, groups);
             * loader.SaveModuleStudyActions(msaDict);*/
            var context  = new ModelContext();
            var fixtures = new Fixtures(context);

            fixtures.InstallFixtures();

            XLSLoader loader  = new XLSLoader(openFileDialog.FileName, context: context);
            var       modules = loader.GetModules();
            var       groups  = loader.GetGroups();
            var       msaDict = loader.GetModuleStudyActionsDict(modules, groups);

            loader.Save(modules, groups);
            loader.SaveModuleStudyActions(msaDict);
            FillK3B();
        }
コード例 #2
0
        private void backgroundWorkerXLS_DoWork(object sender, DoWorkEventArgs e)
        {
            //Get the BackgroundWorker object that raised this event.
            System.ComponentModel.BackgroundWorker worker = (System.ComponentModel.BackgroundWorker)sender;
            //Create XLS Loader
            XLSLoader loader = new XLSLoader(@"C:\Projects\ccg.xls",
                                             XMLRepositoryFactory.Instance,
                                             worker,
                                             e);

            loader.Load();
        }