private void bw_LithoImportRunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { ImportStatusWindow ii = new ImportStatusWindow(); ii.SetData(lastestImportUpdateStatus); ii.ShowDialog(); }
/// <summary> /// The import of assays is complete /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void bw_CoalQualityImportRunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { if (lastestImportUpdateStatus != null) { ImportStatusWindow ii = new ImportStatusWindow(); ii.SetData(lastestImportUpdateStatus); ii.ShowDialog(); } }
private void CollarImportExecuted(object sender, ExecutedRoutedEventArgs e) { if (ComboBoxProjectList.SelectedValue == null) { ComboBoxProjectList.BorderBrush = Brushes.Red; MessageBox.Show("You must select a project before importing"); return; } Guid XODBProjectID = (Guid)ComboBoxProjectList.SelectedValue; bool overwrite = (bool)checkBoxOverwrite.IsChecked; ImportDataMap importMap = MapConfigTable.GetImportDataMap(MapConfigTable.collarPrimaryTableName); // add into map details of which columns are foreign keys if (collarDBFields != null) { importMap.UpdateWithFKInof(collarDBFields); } // get the selected project ID ModelImportStatus status = commandDirector.DoCollarImport(SelectedFile, SelectedFormatFile, importMap, blockRawFileReader, XODBProjectID, overwrite); lastestImportUpdateStatus = status; //if(status.finalErrorCode != ModelImportStatus.OK){ // string ss = status.GenerateStringMessage(true); // lastestImportUpdateStatus.SaveReportData(); // if (status.finalErrorCode == ModelImportStatus.DATA_CONSISTENCY_ERROR) // { // string headline = "Import complete. " + status.linesReadFromSource + " data lines read, " + status.recordsAdded + " new records added \n" + status.recordsUpdated + " existing records updated."; // MessageBox.Show("Warnings issued during import.\n\n" + headline + ".\n\n" + ss); // } // else // { // MessageBox.Show("Import failed. " + ss); // } //}else{ // MessageBox.Show("Import complete. "+status.linesReadFromSource+" data lines read, "+status.recordsAdded+" new records added \n"+status.recordsUpdated+" existing records updated."); //} if (lastestImportUpdateStatus != null) { ImportStatusWindow ii = new ImportStatusWindow(); ii.SetData(lastestImportUpdateStatus); ii.ShowDialog(); } //workerBMDataImport = new BackgroundWorker(); //workerBMDataImport.WorkerReportsProgress = true; //workerBMDataImport.WorkerSupportsCancellation = false; //workerBMDataImport.DoWork += bw_DoCollarImportWork; //// Method to call when Progress has changed //workerBMDataImport.ProgressChanged += bw_BMImportProgressChanged; //// Method to run after BackgroundWorker has completed? //workerBMDataImport.RunWorkerCompleted += bw_BMImportRunWorkerCompleted; //workerBMDataImport.RunWorkerAsync(importMap); e.Handled = true; }