//Opens add test form private void menuAddTest_Click(object sender, System.EventArgs e) { if (null != this.database) { string sqlStmt = "SELECT name FROM sqlite_master WHERE type='table' AND name='TestCase';"; SqliteVm vm = new SqliteVm(this.database, true); if (Sqlite.Row == vm.Execute(sqlStmt)) { //Hack...if the form is not visible then the user must have closed it->create a new one //If it is visible bring it to focus if (!this.addTestForm.Visible) { this.addTestForm = new SqliteGUI.NewAddTestForm(); this.addTestForm.LoadForm(database); this.addTestForm.MdiParent = this; this.addTestForm.Show(); } else { this.addTestForm.Activate(); } } else { System.Windows.Forms.MessageBox.Show("TestCase table does not exist!", "Error", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Hand); } vm.SqlFinalize(); } }
public Form1() { // // Required for Windows Form Designer support // InitializeComponent(); // // TODO: Add any constructor code after InitializeComponent call // this.addTestForm = new SqliteGUI.NewAddTestForm(); }
public Form1() { // // Required for Windows Form Designer support // InitializeComponent(); // // TODO: Add any constructor code after InitializeComponent call // this.addTestForm = new SqliteGUI.NewAddTestForm(); }
//Opens add test form private void menuAddTest_Click(object sender, System.EventArgs e) { if (null != this.database) { string sqlStmt = "SELECT name FROM sqlite_master WHERE type='table' AND name='TestCase';"; SqliteVm vm = new SqliteVm(this.database, true); if (Sqlite.Row == vm.Execute(sqlStmt)) { //Hack...if the form is not visible then the user must have closed it->create a new one //If it is visible bring it to focus if (!this.addTestForm.Visible) { this.addTestForm = new SqliteGUI.NewAddTestForm(); this.addTestForm.LoadForm(database); this.addTestForm.MdiParent = this; this.addTestForm.Show(); } else { this.addTestForm.Activate(); } } else { System.Windows.Forms.MessageBox.Show("TestCase table does not exist!", "Error", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Hand); } vm.SqlFinalize(); } }