/// <summary> /// 初始化dbtune配置工作流程 /// </summary> private void InitDbtuneConfigWorkFlow() { if (this._workFlow == EnumWorkFlow.TablePartition.ToString()) { InitDbConnect(); this.txbDbPort.Text = "5151"; CommonUtil.WriteBlog(this.txbBlog, "--- SDE服务当前未连接"); this.btnImportFeature.Text = string.Empty; this.cmbColumnIdentity.SelectedIndex = -1; this.cmbPartitionWay.SelectedIndex = -1; this.txbTips.Text = string.Empty; this.btnAssignTablespace.Text = string.Empty; this.txbTargetName.Text = string.Empty; this.cmbColumnIdentity.Properties.Items.Clear(); } this.lciConnTips_1.Visibility = LayoutVisibility.Always; this._dbtuneConfigParam = new DbtuneConfigParam(); this._dbtuneConfigParam.Clear(); this._featureClass = null; this._partitionCount = -1; this._columnInfoSet = new Dictionary <string, string>(); this._boundary = new Dictionary <string, double>(); this._partitionInfoSet = new List <PartitionInfo>(); this._partitionRefer = new List <string>(); this.btnImportFeature.Enabled = false; this._tbPtitionHelper = null; this._partitionParam = null; this.cmbTablespace.SelectedIndex = -1; this.cmbOriginTable.SelectedIndex = -1; this.cmbTablespace.Properties.Items.Clear(); this.cmbOriginTable.Properties.Items.Clear(); this._dbtuneManageHelper = null; this.cmbDbtuneKeyWord.SelectedIndex = -1; this.txbDbtuneParamValue.Text = string.Empty; this.cmbDbtuneKeyWord.Properties.Items.Clear(); this.lciConnTips_2.Visibility = LayoutVisibility.Never; this._workFlow = EnumWorkFlow.DbtuneConfigure.ToString(); }
/// <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; } } } } }