/// <summary>
        /// 刷新数据事件
        /// </summary>
        /// <param name="meterGroup"></param>
        /// <param name="taiType"></param>
        /// <param name="taiId"></param>
        public void RefreshData(CLDC_DataCore.Model.DnbModel.DnbGroupInfo meterGroup, int CheckOrderID)
        {
            if (!(meterGroup.CheckPlan[CheckOrderID] is CLDC_DataCore.Struct.StPlan_PrePareTest))
            {
                return;
            }

            CLDC_DataCore.Struct.StPlan_PrePareTest item  = (CLDC_DataCore.Struct.StPlan_PrePareTest)meterGroup.CheckPlan[CheckOrderID];
            CLDC_DataCore.Struct.StPlan_Dgn         _Item = new CLDC_DataCore.Struct.StPlan_Dgn();// (CLDC_DataCore.Struct.StPlan_Dgn)meterGroup.CheckPlan[CheckOrderID];
            _Item.DgnPrjName   = item.PrePrjName;
            _Item.DgnPrjID     = item.PrePrjID;
            _Item.PrjParm      = item.PrjParm;
            _Item.OutPramerter = item.OutPramerter;
            bool bFind = false;

            if (Tab_Prepare.TabPages.Count > 1)            //如果Tab的页数大于1,那表示存在动态增加的数据页
            {
                if (Data_Prepare.Tag != null && Data_Prepare.Tag.ToString() == _Item.DgnPrjID)
                {
                    bFind = true;
                }
                else
                {
                    for (int i = Tab_Prepare.TabPages.Count - 1; i > 0; i--)
                    {
                        Tab_Prepare.TabPages.RemoveAt(i);
                    }
                    bFind = false;
                }
            }

            if (!bFind)
            {
                Data_Prepare.Tag = _Item.DgnPrjID;          //将ID值放到数据列表的Tag中,供数据刷新使用

                switch (_Item.DgnPrjID)
                {
                    #region
                case "002":
                {
                    int      Count;
                    string[] str = _Item.PrjParm.Split('|');
                    if (str.Length >= 2)
                    {
                        int.TryParse(str[1], out Count);
                    }
                    else
                    {
                        Count = 10;
                    }
                    Tab_Prepare.TabPages.Add("日计时误差数据");
                    CLDC_MeterUI.UI_Detection_New.DgnDataView.ViewDateTimeErr _DateTimeErr = new CLDC_MeterUI.UI_Detection_New.DgnDataView.ViewDateTimeErr(Count);
                    Tab_Prepare.TabPages[1].Controls.Add(_DateTimeErr);
                    _DateTimeErr.Dock   = DockStyle.Fill;
                    _DateTimeErr.Margin = new System.Windows.Forms.Padding(0);
                    break;
                }

                case "003":
                {
                    Tab_Prepare.TabPages.Add("费率时段数据");
                    CLDC_MeterUI.UI_Detection_New.DgnDataView.ViewReadPeriod _Period = new CLDC_MeterUI.UI_Detection_New.DgnDataView.ViewReadPeriod(_Item);
                    Tab_Prepare.TabPages[1].Controls.Add(_Period);
                    _Period.Dock   = DockStyle.Fill;
                    _Period.Margin = new System.Windows.Forms.Padding(0);
                    break;
                }

                case "004":
                case "028":
                case "029":
                case "030":
                {
                    Tab_Prepare.TabPages.Add("时段投切数据");
                    CLDC_MeterUI.UI_Detection_New.DgnDataView.ViewSdtq _Sdtq = new CLDC_MeterUI.UI_Detection_New.DgnDataView.ViewSdtq(_Item);
                    Tab_Prepare.TabPages[1].Controls.Add(_Sdtq);
                    _Sdtq.Dock   = DockStyle.Fill;
                    _Sdtq.Margin = new System.Windows.Forms.Padding(0);
                    break;
                }

                case "005":
                case "031":
                case "032":
                case "033":
                {
                    Tab_Prepare.TabPages.Add("计度器示值组合误差数据");
                    CLDC_MeterUI.UI_Detection_New.DgnDataView.ViewRegister _Register = new CLDC_MeterUI.UI_Detection_New.DgnDataView.ViewRegister(_Item);
                    Tab_Prepare.TabPages[1].Controls.Add(_Register);
                    _Register.Dock   = DockStyle.Fill;
                    _Register.Margin = new System.Windows.Forms.Padding(0);
                    break;
                }

                case "006":
                case "034":
                case "035":
                case "036":
                {
                    Tab_Prepare.TabPages.Add("费率时段示值误差数据");
                    CLDC_MeterUI.UI_Detection_New.DgnDataView.ViewRatePeriod _RatePeriod = new CLDC_MeterUI.UI_Detection_New.DgnDataView.ViewRatePeriod(_Item);
                    Tab_Prepare.TabPages[1].Controls.Add(_RatePeriod);
                    _RatePeriod.Dock   = DockStyle.Fill;
                    _RatePeriod.Margin = new System.Windows.Forms.Padding(0);
                    break;
                }

                case "013":
                {
                    Tab_Prepare.TabPages.Add("时间误差");
                    CLDC_MeterUI.UI_Detection_New.DgnDataView.ViewGpsTime _Gps = new CLDC_MeterUI.UI_Detection_New.DgnDataView.ViewGpsTime();
                    Tab_Prepare.TabPages[1].Controls.Add(_Gps);
                    _Gps.Dock   = DockStyle.Fill;
                    _Gps.Margin = new System.Windows.Forms.Padding(0);
                    break;
                }

                case "019":
                {
                    Tab_Prepare.TabPages.Add("电量寄存器检查");
                    CLDC_MeterUI.UI_Detection_New.DgnDataView.ViewMemoryCheck _MemortCheck = new CLDC_MeterUI.UI_Detection_New.DgnDataView.ViewMemoryCheck();
                    Tab_Prepare.TabPages[1].Controls.Add(_MemortCheck);
                    _MemortCheck.Dock   = DockStyle.Fill;
                    _MemortCheck.Margin = new System.Windows.Forms.Padding(0);
                    break;
                }

                case "014":
                {
                    Tab_Prepare.TabPages.Add("最大需量0.1Ib数据");
                    CLDC_MeterUI.UI_Detection_New.DgnDataView.ViewMaxXl _MaxXl = new CLDC_MeterUI.UI_Detection_New.DgnDataView.ViewMaxXl(_Item);
                    Tab_Prepare.TabPages[1].Controls.Add(_MaxXl);
                    _MaxXl.Dock   = DockStyle.Fill;
                    _MaxXl.Margin = new System.Windows.Forms.Padding(0);
                    break;
                }

                case "015":
                {
                    Tab_Prepare.TabPages.Add("最大需量1.0Ib数据");
                    CLDC_MeterUI.UI_Detection_New.DgnDataView.ViewMaxXl _MaxXl = new CLDC_MeterUI.UI_Detection_New.DgnDataView.ViewMaxXl(_Item);
                    Tab_Prepare.TabPages[1].Controls.Add(_MaxXl);
                    _MaxXl.Dock   = DockStyle.Fill;
                    _MaxXl.Margin = new System.Windows.Forms.Padding(0);
                    break;
                }

                case "016":
                {
                    Tab_Prepare.TabPages.Add("最大需量Imax数据");
                    CLDC_MeterUI.UI_Detection_New.DgnDataView.ViewMaxXl _MaxXl = new CLDC_MeterUI.UI_Detection_New.DgnDataView.ViewMaxXl(_Item);
                    Tab_Prepare.TabPages[1].Controls.Add(_MaxXl);
                    _MaxXl.Dock   = DockStyle.Fill;
                    _MaxXl.Margin = new System.Windows.Forms.Padding(0);
                    break;
                }

                case "017":
                {
                    Tab_Prepare.TabPages.Add("读取电量数据");
                    CLDC_MeterUI.UI_Detection_New.DgnDataView.ViewDianLiang _DianLiang = new CLDC_MeterUI.UI_Detection_New.DgnDataView.ViewDianLiang(_Item);
                    Tab_Prepare.TabPages[1].Controls.Add(_DianLiang);
                    _DianLiang.Dock   = DockStyle.Fill;
                    _DianLiang.Margin = new System.Windows.Forms.Padding(0);
                    break;
                }

                case "043":
                {
                    Tab_Prepare.TabPages.Add("阶梯电价检查");
                    CLDC_MeterUI.UI_Detection_New.DgnDataView.ViewStepTariff stepPrice = new CLDC_MeterUI.UI_Detection_New.DgnDataView.ViewStepTariff(_Item);
                    Tab_Prepare.TabPages[1].Controls.Add(stepPrice);
                    stepPrice.Dock   = DockStyle.Fill;
                    stepPrice.Margin = new System.Windows.Forms.Padding(0);
                }
                break;

                case "044":
                {
                    Tab_Prepare.TabPages.Add("费率电价检查");
                    CLDC_MeterUI.UI_Detection_New.DgnDataView.ViewRatesTime ratesPrice = new CLDC_MeterUI.UI_Detection_New.DgnDataView.ViewRatesTime(_Item);
                    Tab_Prepare.TabPages[1].Controls.Add(ratesPrice);
                    ratesPrice.Dock   = DockStyle.Fill;
                    ratesPrice.Margin = new System.Windows.Forms.Padding(0);
                }
                break;
                    #endregion
                }
            }
            this.RefreshGrid(meterGroup, CheckOrderID);

            Data_Prepare.Enabled = true;
        }
        /// <summary>
        /// 刷新数据事件
        /// </summary>
        /// <param name="meterGroup"></param>
        /// <param name="taiType"></param>
        /// <param name="taiId"></param>
        public void RefreshData(CLDC_DataCore.Model.DnbModel.DnbGroupInfo meterGroup, int CheckOrderID)
        {
            if (!(meterGroup.CheckPlan[CheckOrderID] is CLDC_DataCore.Struct.StPlan_CostControl))
            {
                return;
            }

            CLDC_DataCore.Struct.StPlan_CostControl _Item = (CLDC_DataCore.Struct.StPlan_CostControl)meterGroup.CheckPlan[CheckOrderID];

            bool bFind = false;

            if (Tab_CostControl.TabPages.Count > 1)            //如果Tab的页数大于1,那表示存在动态增加的数据页
            {
                if (Data_Cost.Tag != null && Data_Cost.Tag.ToString() == _Item.CostControlPrjID)
                {
                    bFind = true;
                }
                else
                {
                    for (int i = Tab_CostControl.TabPages.Count - 1; i > 0; i--)
                    {
                        Tab_CostControl.TabPages.RemoveAt(i);
                    }
                    bFind = false;
                }
            }

            if (!bFind)
            {
                Data_Cost.Tag = _Item.CostControlPrjID;          //将ID值放到数据列表的Tag中,供数据刷新使用

                switch (_Item.CostControlPrjID)
                {
                case "002":
                {
                    Tab_CostControl.TabPages.Add("远程控制数据");
                    CLDC_MeterUI.UI_Detection_New.CostControlDataView.ViewUserControlData _View = new CLDC_MeterUI.UI_Detection_New.CostControlDataView.ViewUserControlData(_Item);
                    Tab_CostControl.TabPages[1].Controls.Add(_View);
                    _View.Dock   = DockStyle.Fill;
                    _View.Margin = new Padding(0);
                    break;
                }

                case "003":
                {
                    Tab_CostControl.TabPages.Add("报警功能数据");
                    CLDC_MeterUI.UI_Detection_New.CostControlDataView.ViewWaringData _View = new CLDC_MeterUI.UI_Detection_New.CostControlDataView.ViewWaringData(_Item);
                    Tab_CostControl.TabPages[1].Controls.Add(_View);
                    _View.Dock   = DockStyle.Fill;
                    _View.Margin = new Padding(0);
                    break;
                }

                case "007":
                {
                    Tab_CostControl.TabPages.Add("ESAM数据回抄数据");
                    CLDC_MeterUI.UI_Detection_New.CostControlDataView.ViewESAMDataReturn _View = new CLDC_MeterUI.UI_Detection_New.CostControlDataView.ViewESAMDataReturn(_Item);
                    Tab_CostControl.TabPages[1].Controls.Add(_View);
                    _View.Dock   = DockStyle.Fill;
                    _View.Margin = new Padding(0);
                    break;
                }

                case "009":
                {
                    Tab_CostControl.TabPages.Add("剩余电量递减准确度");
                    CLDC_MeterUI.UI_Detection_New.CostControlDataView.ViewLeftEnergyAccuracy _View = new CLDC_MeterUI.UI_Detection_New.CostControlDataView.ViewLeftEnergyAccuracy(_Item);
                    Tab_CostControl.TabPages[1].Controls.Add(_View);
                    _View.Dock   = DockStyle.Fill;
                    _View.Margin = new Padding(0);
                    break;
                }

                case "011":
                {
                    Tab_CostControl.TabPages.Add("负荷开关数据");
                    CLDC_MeterUI.UI_Detection_New.CostControlDataView.ViewLoadSwitchData _View = new CLDC_MeterUI.UI_Detection_New.CostControlDataView.ViewLoadSwitchData(_Item);
                    Tab_CostControl.TabPages[1].Controls.Add(_View);
                    _View.Dock   = DockStyle.Fill;
                    _View.Margin = new Padding(0);
                    break;
                }

                case "013":
                {
                    Tab_CostControl.TabPages.Add("密钥更新数据");
                    CLDC_MeterUI.UI_Detection_New.CostControlDataView.ViewKeyUpdateData _View = new CLDC_MeterUI.UI_Detection_New.CostControlDataView.ViewKeyUpdateData(_Item);
                    Tab_CostControl.TabPages[1].Controls.Add(_View);
                    _View.Dock   = DockStyle.Fill;
                    _View.Margin = new Padding(0);
                    break;
                }

                case "014":
                {
                    Tab_CostControl.TabPages.Add("密钥恢复数据");
                    CLDC_MeterUI.UI_Detection_New.CostControlDataView.ViewKeyRecoveryData _View = new CLDC_MeterUI.UI_Detection_New.CostControlDataView.ViewKeyRecoveryData(_Item);
                    Tab_CostControl.TabPages[1].Controls.Add(_View);
                    _View.Dock   = DockStyle.Fill;
                    _View.Margin = new Padding(0);
                    break;
                }

                case "015":
                {
                    Tab_CostControl.TabPages.Add("控制功能数据");
                    CLDC_MeterUI.UI_Detection_New.CostControlDataView.ViewControlFunction _View = new CLDC_MeterUI.UI_Detection_New.CostControlDataView.ViewControlFunction(_Item);
                    Tab_CostControl.TabPages[1].Controls.Add(_View);
                    _View.Dock   = DockStyle.Fill;
                    _View.Margin = new Padding(0);
                    break;
                }

                case "016":
                {
                    Tab_CostControl.TabPages.Add("阶梯电价检查");
                    CLDC_MeterUI.UI_Detection_New.DgnDataView.ViewStepTariff stepPrice = new CLDC_MeterUI.UI_Detection_New.DgnDataView.ViewStepTariff(_Item);
                    Tab_CostControl.TabPages[1].Controls.Add(stepPrice);
                    stepPrice.Dock   = DockStyle.Fill;
                    stepPrice.Margin = new System.Windows.Forms.Padding(0);
                }
                break;

                case "017":
                {
                    Tab_CostControl.TabPages.Add("费率电价检查");
                    CLDC_MeterUI.UI_Detection_New.DgnDataView.ViewRatesTime ratesPrice = new CLDC_MeterUI.UI_Detection_New.DgnDataView.ViewRatesTime(_Item);
                    Tab_CostControl.TabPages[1].Controls.Add(ratesPrice);
                    ratesPrice.Dock   = DockStyle.Fill;
                    ratesPrice.Margin = new System.Windows.Forms.Padding(0);
                }
                break;

                case "018":
                {
                    Tab_CostControl.TabPages.Add("远程控制直接合闸数据");
                    CLDC_MeterUI.UI_Detection_New.CostControlDataView.ViewDirectCloseTrip _View = new CLDC_MeterUI.UI_Detection_New.CostControlDataView.ViewDirectCloseTrip(_Item);
                    Tab_CostControl.TabPages[1].Controls.Add(_View);
                    _View.Dock   = DockStyle.Fill;
                    _View.Margin = new Padding(0);
                    break;
                }

                case "022":     //@C_B
                {
                    Tab_CostControl.TabPages.Add("预置内容数据");
                    CLDC_MeterUI.UI_Detection_New.CostControlDataView.ViewPresetContent _View = new CLDC_MeterUI.UI_Detection_New.CostControlDataView.ViewPresetContent(_Item);
                    Tab_CostControl.TabPages[1].Controls.Add(_View);
                    _View.Dock   = DockStyle.Fill;
                    _View.Margin = new Padding(0);
                    break;
                }

                case "023":
                {
                    Tab_CostControl.TabPages.Add("本地模式切换远程模式");
                    CLDC_MeterUI.UI_Detection_New.CostControlDataView.ViewChangeRemoteMode _View = new CLDC_MeterUI.UI_Detection_New.CostControlDataView.ViewChangeRemoteMode(_Item);
                    Tab_CostControl.TabPages[1].Controls.Add(_View);
                    _View.Dock   = DockStyle.Fill;
                    _View.Margin = new Padding(0);
                }
                break;

                case "024":
                {
                    Tab_CostControl.TabPages.Add("远程模式切换本地模式");
                    CLDC_MeterUI.UI_Detection_New.CostControlDataView.ViewChangeLocalMode _View = new CLDC_MeterUI.UI_Detection_New.CostControlDataView.ViewChangeLocalMode(_Item);
                    Tab_CostControl.TabPages[1].Controls.Add(_View);
                    _View.Dock   = DockStyle.Fill;
                    _View.Margin = new Padding(0);
                }
                break;

                case "025":
                {
                    Tab_CostControl.TabPages.Add("用户卡开户");
                    CLDC_MeterUI.UI_Detection_New.CostControlDataView.ViewUserCardInitUser _View = new CLDC_MeterUI.UI_Detection_New.CostControlDataView.ViewUserCardInitUser(_Item);
                    Tab_CostControl.TabPages[1].Controls.Add(_View);
                    _View.Dock   = DockStyle.Fill;
                    _View.Margin = new Padding(0);
                }
                break;

                case "026":
                {
                    Tab_CostControl.TabPages.Add("透支功能");
                    CLDC_MeterUI.UI_Detection_New.CostControlDataView.ViewOverdrawData _View = new CLDC_MeterUI.UI_Detection_New.CostControlDataView.ViewOverdrawData(_Item);
                    Tab_CostControl.TabPages[1].Controls.Add(_View);
                    _View.Dock   = DockStyle.Fill;
                    _View.Margin = new Padding(0);
                }
                break;
                }
            }

            this.RefreshGrid(meterGroup, CheckOrderID);

            Data_Cost.Enabled = true;
        }