Beispiel #1
0
        /// <summary>
        /// 执行按钮点击事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnExcute_Click(object sender, EventArgs e)
        {
            //判断当前工作流程
            switch (this.tabWorkFlow.SelectedTabPageIndex)
            {
            case (int)EnumWorkFlow.TablePartition:     //表分区工作流程
                SetPartitionParam();
                if (CommonUtil.CheckPartitionParam(this.txbBlog, this._partitionParam))
                {
                    GwWaitForm.Start("正在执行");
                    this.Cursor = Cursors.WaitCursor;
                    CommonUtil.ExcutePartition(this.txbBlog, this._partitionParam, this._tbPtitionHelper);
                    GwWaitForm.Stop();
                    this.Cursor = Cursors.Arrow;
                }
                break;

            case (int)EnumWorkFlow.DbtuneConfigure:     //dbtune配置工作流程
                SetDbtuneConfigParam();
                if (CommonUtil.CheckDbtuneConfigParam(this.txbBlog, this._dbtuneConfigParam))
                {
                    GwWaitForm.Start("正在执行");
                    this.Cursor = Cursors.WaitCursor;
                    CommonUtil.ExcuteDbtuneConfig(this.txbBlog, this._dbtuneConfigParam, this._dbtuneConfigHelper);
                    GwWaitForm.Stop();
                    this.Cursor = Cursors.Arrow;
                }
                break;

            default:
                break;
            }
        }
Beispiel #2
0
        /// <summary>
        /// 范围分区工作准备
        /// </summary>
        private void PrepareRangePartition()
        {
            GwWaitForm.Start("正在查找范围边界");
            this.Cursor = Cursors.WaitCursor;

            //根据工作流程,查找分区基准列的边界
            if (this.tabWorkFlow.SelectedTabPageIndex == (int)EnumWorkFlow.TablePartition)
            {
                this._boundary = QueryUnityInfo.QueryBoundary(this._dbHelper, this.cmbColumnIdentity.SelectedItem.ToString(), this.cmbOriginTable.SelectedItem.ToString());
            }
            else if (this.tabWorkFlow.SelectedTabPageIndex == (int)EnumWorkFlow.DbtuneConfigure)
            {
                this._boundary = QueryUnityInfo.QueryBoundary(this._featureClass, this.cmbColumnIdentity.SelectedItem.ToString());
            }

            this.Cursor = Cursors.Arrow;
            GwWaitForm.Stop();

            //打开指定分区数的窗体
            if (this._frmAssignRange == null || this._frmAssignRange.IsDisposed)
            {
                this._frmAssignRange = new FormAssignRange(this._boundary["MIN"], this._boundary["MAX"]);
            }

            this._frmAssignRange.ShowDialog();

            //如果取消指定分区数,则默认采用列表分区
            if (this._frmAssignRange.IsCancel)
            {
                this.cmbPartitionWay.SelectedIndex = (int)EnumPartitionWay.List;
                //转而进行列表分区工作准备
                PrepareListPartition("已取消范围分区,默认采用列表分区,正在分析分区数量");
            }
            else
            {
                this._partitionCount = this._frmAssignRange.PartitionCount;

                this._partitionRefer = CommonUtil.GetPartitionRefer(this._partitionCount, this._boundary);

                this._partitionInfoSet = CommonUtil.GetPartitionInfoSet(this.cmbPartitionWay.SelectedIndex, this.cmbColumnIdentity.SelectedItem.ToString(), this._partitionRefer);

                this.txbTips.Text = string.Format("{0} ~ {1}   分区数:{2}", this._boundary["MIN"].ToString("0.00"), this._boundary["MAX"].ToString("0.00"), this._partitionCount);
            }

            this._frmAssignRange = null;
        }
Beispiel #3
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;
                        }
                    }
                }
            }
        }
Beispiel #4
0
        /// <summary>
        /// 列表分区工作准备
        /// </summary>
        /// <param name="tips"></param>
        private void PrepareListPartition(string tips)
        {
            GwWaitForm.Start(tips);
            this.Cursor = Cursors.WaitCursor;

            //根据工作流程,查找分区描述信息
            if (this.tabWorkFlow.SelectedTabPageIndex == (int)EnumWorkFlow.TablePartition)
            {
                this._partitionRefer = CommonUtil.GetPartitionRefer(this.cmbColumnIdentity.SelectedItem.ToString(), this.cmbOriginTable.SelectedItem.ToString(), this._dbHelper);
            }
            else if (this.tabWorkFlow.SelectedTabPageIndex == (int)EnumWorkFlow.DbtuneConfigure)
            {
                this._partitionRefer = CommonUtil.GetPartitionRefer(this.cmbColumnIdentity.SelectedItem.ToString(), this._featureClass);
            }

            this._partitionCount = this._partitionRefer.Count;

            this.Cursor = Cursors.Arrow;
            GwWaitForm.Stop();

            this._partitionInfoSet = CommonUtil.GetPartitionInfoSet(this.cmbPartitionWay.SelectedIndex, this.cmbColumnIdentity.SelectedItem.ToString(), this._partitionRefer);

            this.txbTips.Text = string.Format("分区数:{0}", this._partitionCount.ToString());
        }