Exemplo n.º 1
0
        /// <summary>
        /// 连接数据库按钮的点击事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnTryConnect_Click(object sender, EventArgs e)
        {
            SetDbConnectParam();

            if (CommonUtil.CheckConnectParam(this.txbBlog, this._dbConnectParam))
            {
                if (this.tabWorkFlow.SelectedTabPageIndex == (int)EnumWorkFlow.TablePartition)
                {
                    if (CommonUtil.TryConnect(this.txbBlog, ref this._dbHelper, this._dbConnectParam, EnumWorkFlow.TablePartition))
                    {
                        CommonUtil.BindcmbTablespace(this.cmbTablespace, this._dbHelper);
                    }
                }
                else
                {
                    if (CommonUtil.TryConnect(this.txbBlog, ref this._dbHelper, this._dbConnectParam, EnumWorkFlow.NotTablePartition))
                    {
                        if (this.tabWorkFlow.SelectedTabPageIndex == (int)EnumWorkFlow.DbtuneConfigure)
                        {
                            this.btnImportFeature.Enabled = true;
                            this.lciConnTips_1.Visibility = LayoutVisibility.Never;
                        }
                        else if (this.tabWorkFlow.SelectedTabPageIndex == (int)EnumWorkFlow.DbtuneManage)
                        {
                            this._dbtuneManageHelper = new DbtuneManageHelper(this._dbHelper, Environment.CurrentDirectory);

                            GwWaitForm.Start("正在收集dbtune配置关键字");
                            this.Cursor = Cursors.WaitCursor;
                            CommonUtil.BindcmbDbtuneKeyWord(this.cmbDbtuneKeyWord, dbHelper: this._dbHelper, filePath: Environment.CurrentDirectory);
                            GwWaitForm.Stop();

                            this.cmbDbtuneKeyWord.Enabled = true;
                            this.lciConnTips_2.Visibility = LayoutVisibility.Never;
                        }
                    }
                }
            }
        }