private void SaveQuery() { try { if (txtQuery.Text != "") { String queryName = xtraTabDatabase.TabPages[2].Text.Substring(5); String queryText = txtQuery.Text; frmQueryEditor frm = new frmQueryEditor(fdbEntity.Queries) { TxtQueryName = queryName, TxtQueryText = queryText }; frm.ShowDialog(); //After form close fdbEntity.Queries = frm.Queries; DBValues.queriesName = FzQueryBLL.ListOfQueryName(fdbEntity); ShowTreeList(); ShowTreeListNode(); treeList1.ExpandAll(); currentQuery = null; OpenQuery(frm.QueryName); } else { xtraTabDatabase.SelectedTabPageIndex = 2; txtQuery.Focus(); MessageBox.Show("Please input some text to save!"); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void QueryEditor() { try { if (fdbEntity == null) { MessageBox.Show("Current database is empty!"); return; } frmQueryEditor frm = new frmQueryEditor(fdbEntity.Queries); frm.ShowDialog(); //After form close fdbEntity.Queries = frm.Queries; DBValues.queriesName = FzQueryBLL.ListOfQueryName(fdbEntity); ShowTreeList(); ShowTreeListNode(); treeList1.ExpandAll(); //Open query OpenQuery(frm.QueryName); if (currentQuery == null) CloseCurrentQuery(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }