Esempio n. 1
0
        private void tsbtnExecuteQuery_Click(object sender, EventArgs e)
        {
            ToolStripButton tsbtn = sender as ToolStripButton;

            if (tsbtn != null)
            {
                if (tsbtn.Equals(this.tsbtnExecuteQuery))
                {
                    ucQuery query = this.tabControl1.SelectedTab.Tag as ucQuery;
                    query.ExecuteQuery(false, 0, false);
                }
                else if (tsbtn.Equals(this.tsbtnAddTab))
                {
                    this.tabControl1.TabPages.Add("SQL");
                    this.tabControl1.SelectedIndex = this.tabControl1.TabCount - 1;

                    ucQuery query = new ucQuery();
                    query.Dock = DockStyle.Fill;
                    this.tabControl1.SelectedTab.Controls.Add(query);
                    this.tabControl1.SelectedTab.Tag = query;
                    query.SetFocusDDLBox();

                    this.SetCtrlEnabledByTabPageCnt();
                }
                else if (tsbtn.Equals(this.tsbtnRemoveTab))
                {
                    if (this.tabControl1.TabPages.Count > 0)
                    {
                        this.tabControl1.TabPages.Remove(this.tabControl1.SelectedTab);
                        this.tabControl1.SelectedIndex = this.tabControl1.TabCount - 1;
                    }

                    this.SetCtrlEnabledByTabPageCnt();
                }
                else if (tsbtn.Equals(this.tsbtnCommit))
                {
                    Common.Comm.DBWorker.CommitTrans();

                    ucQuery query = this.tabControl1.SelectedTab.Tag as ucQuery;
                    query.SetCtrlProp_Committed();
                }
                else if (tsbtn.Equals(this.tsbtnRollback))
                {
                    Common.Comm.DBWorker.RollbackTrans();

                    ucQuery query = this.tabControl1.SelectedTab.Tag as ucQuery;
                    query.SetCtrlProp_Rollbacked();
                }
                else if (tsbtn.Equals(this.tsbtnExportExcel))
                {
                    ucQuery query = this.tabControl1.SelectedTab.Tag as ucQuery;
                    query.ExportExcelQueryResult();
                }
            }
        }
Esempio n. 2
0
        private void userControl11_ItemDoubleClicked(object sender, Common.Definition.EventHandler.ItemDoubleClickEventArgs e)
        {
            ucQuery query = this.tabControl1.SelectedTab.Tag as ucQuery;

            query.AddObjectName(e.ItemName);
        }