Пример #1
0
        private void SelectExcelFile_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog openFile = new OpenFileDialog();

            if (openFile.ShowDialog() == true)
            {
                using (ImporterClass import = new ImporterClass())
                {
                    import.RunValidation(openFile.FileName);
                }
            }
        }
Пример #2
0
        protected void DoImport(string schemaPath, string fsPath, string repositoryPath)
        {
            var savedMode = RepositoryConfiguration.WorkingMode.Importing;

            RepositoryConfiguration.WorkingMode.SetImporting(true);
            try
            {
                var importer = new ImporterClass();
                importer.Run(schemaPath, fsPath, repositoryPath, LogLevel);

                if (importer.ErrorOccured && this.AbortOnError)
                {
                    throw new ApplicationException("Error occured during importing, please review the log.");
                }
            }
            finally
            {
                RepositoryConfiguration.WorkingMode.SetImporting(savedMode);
            }
        }