protected internal override string OnWizardNext() { //Change the mouse cursor to hourglass //Cursor = Cursors.WaitCursor; //This is a hack so that we won't create the file if the import //path is wrong and then when the user fixes the import path, //a file already exists exception is thrown. if (!File.Exists(ndbv.REIMSPath + "GLSKU.DBF") || !File.Exists(ndbv.REIMSPath + "DISPENSE.DBF")) { MessageBox.Show("One of the REIMS database files does not exist. The data could not " + "be imported.", "Error: Import Failure", MessageBoxButtons.OK, MessageBoxIcon.Error); return("NewDBPage4"); } //Create the database file try { mydb.CreateNewDB(ndbv.Path, ndbv.Name, ndbv.Location); } catch (IOException e) { MessageBox.Show(e.Message, "Error: Database File Exists", MessageBoxButtons.OK, MessageBoxIcon.Error); return("NewDBPage3"); } //Import try { mydb.ImportREIMS(ndbv.REIMSPath); } catch (Exception e) { MessageBox.Show(e.Message, "Error: Import Failure", MessageBoxButtons.OK, MessageBoxIcon.Error); return("NewDBPage3"); } return("NewDBPage6"); }
protected internal override string OnWizardNext() { //Change the mouse cursor to hourglass Cursor.Current = Cursors.WaitCursor; //Create the database file try { mydb.CreateNewDB(ndbv.Path, ndbv.Name, ndbv.Location); } catch (IOException e) { Cursor.Current = Cursors.Default; MessageBox.Show(e.Message, "Error: Database File Exists", MessageBoxButtons.OK, MessageBoxIcon.Error); return("NewDBPage8"); } Cursor.Current = Cursors.Default; return("NewDBPage7"); }