private void GenerateScripts(SQLScriptGenerator generate) { try { generate.GenerationComplete += scriptGenerator_GenerationComplete; generate.GenerationError += scriptGenerator_GenerationError; generate.ScriptBeginGeneration += scriptGenerator_ScriptBeginGeneration; generate.ScriptEndGeneration += scriptGenerator_ScriptEndGeneration; generate.Generate(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void buttonStart_Click(object sender, EventArgs e) { bool allowgeneration = this.comboBoxDatabase.Text != String.Empty && this.comboBoxMysqlDB.Text != String.Empty; bool begingeneration = true; Properties.Settings.Default.DefaultControlfile = this.textBoxFile.Text; Properties.Settings.Default.Save(); if (!allowgeneration) { begingeneration = false; MessageBox.Show("Please select Database!", "Generation", MessageBoxButtons.OK, MessageBoxIcon.Information); if (this.comboBoxDatabase.Text != String.Empty) { this.comboBoxDatabase.Focus(); } if (this.comboBoxMysqlDB.Text != String.Empty) { this.comboBoxMysqlDB.Focus(); } } if (begingeneration && !File.Exists(this.textBoxFile.Text)) { MessageBox.Show("Control file does not exist! Please look for file named " + ConvertControl + ".", "Generation", MessageBoxButtons.OK, MessageBoxIcon.Information); } if (begingeneration== true && MessageBox.Show("Are you sure you wan't to generate MYSQL database to MSSQL?", "Generation", MessageBoxButtons.YesNo) == DialogResult.Yes) { begingeneration = true; } else { begingeneration = false; } if(begingeneration == true) { setControl(false); try { SQLScriptGenerator generate = new SQLScriptGenerator(this.textBoxConnectionString.Text, this.textBoxMysqlConnectionStr.Text, this.comboBoxDatabase.Text, this.comboBoxMysqlDB.Text, this.textBoxFile.Text, this.checkBoxImportantMsg.Checked, checkBoxScriptMsg.Checked, this.checkBoxRetrievalMsg.Checked, this.checkBoxAlterMsg.Checked); this.richTextBoxMessage.Text = ""; Thread generationThread = new Thread(delegate() { GenerateScripts(generate); }); generationThread.Start(); } catch (Exception ex) { MessageBox.Show(ex.Message); } } }
private void buttonStart_Click(object sender, EventArgs e) { bool allowgeneration = this.comboBoxDatabase.Text != String.Empty && this.comboBoxMysqlDB.Text != String.Empty; bool begingeneration = true; Properties.Settings.Default.DefaultControlfile = this.textBoxFile.Text; Properties.Settings.Default.Save(); if (!allowgeneration) { begingeneration = false; MessageBox.Show("Please select Database!", "Generation", MessageBoxButtons.OK, MessageBoxIcon.Information); if (this.comboBoxDatabase.Text != String.Empty) { this.comboBoxDatabase.Focus(); } if (this.comboBoxMysqlDB.Text != String.Empty) { this.comboBoxMysqlDB.Focus(); } } if (begingeneration && !File.Exists(this.textBoxFile.Text)) { MessageBox.Show("Control file does not exist! Please look for file named " + ConvertControl + ".", "Generation", MessageBoxButtons.OK, MessageBoxIcon.Information); } if (begingeneration == true && MessageBox.Show("Are you sure you wan't to generate MYSQL database to MSSQL?", "Generation", MessageBoxButtons.YesNo) == DialogResult.Yes) { begingeneration = true; } else { begingeneration = false; } if (begingeneration == true) { setControl(false); try { SQLScriptGenerator generate = new SQLScriptGenerator(this.textBoxConnectionString.Text, this.textBoxMysqlConnectionStr.Text, this.comboBoxDatabase.Text, this.comboBoxMysqlDB.Text, this.textBoxFile.Text, this.checkBoxImportantMsg.Checked, checkBoxScriptMsg.Checked, this.checkBoxRetrievalMsg.Checked, this.checkBoxAlterMsg.Checked); this.richTextBoxMessage.Text = ""; Thread generationThread = new Thread(delegate() { GenerateScripts(generate); }); generationThread.Start(); } catch (Exception ex) { MessageBox.Show(ex.Message); } } }