private string HandleBarCode(string matchBarCode)
 {
     if (_workFlowView != null && (_workFlowView.HasManualHandle ||
                                   (matchBarCode.StartsWith("BCB") || matchBarCode.StartsWith("BCC") ||
                                    matchBarCode.StartsWith("BCU"))))
     {
         return(_workFlowView.HandleScanBarCode(matchBarCode));
     }
     else if (matchBarCode == _okBarCode)
     {
         _validationResullt = string.Empty;
         OnConfirmBtnClick(null, null);
         _validationResullt = string.IsNullOrEmpty(_validationResullt) ? PromptMessageXmlHelper.Instance.GetPromptMessage("scanpass", EnumPromptMessage.warning) : _validationResullt;
         return(_validationResullt);
     }
     else if (matchBarCode == _closeBarCode)
     {
         OnCancelBtnClick(null, null);
         return(PromptMessageXmlHelper.Instance.GetPromptMessage("scanpass", EnumPromptMessage.warning));
     }
     else if (matchBarCode.StartsWith("BCX"))
     {
         if (buttonGroup != null)
         {
             bool isFind = false;
             Dictionary <string, string> operation = null;
             foreach (var item in buttonGroup.Items)
             {
                 operation = item as Dictionary <string, string>;
                 if (operation != null && operation.ContainsKey("op_barCode") &&
                     operation["op_barCode"] == matchBarCode && operation.ContainsKey("function_name"))
                 {
                     isFind = true;
                     break;
                 }
             }
             if (isFind && _canTriggerNext)
             {
                 _canTriggerNext = false;
                 this.Invoke(new Action(() => {
                     BarCodeHolder.Stop();
                     if (_workFlowView != null)
                     {
                         MethodInfo methodInfo = _workFlowView.GetType().GetMethod(operation["function_name"]);
                         if (methodInfo != null)
                         {
                             methodInfo.Invoke(_workFlowView, null);
                         }
                     }
                     BarCodeHolder.Start(false);
                     _canTriggerNext = true;
                 }));
             }
         }
         return(PromptMessageXmlHelper.Instance.GetPromptMessage("scanpass", EnumPromptMessage.warning));
     }
     return(PromptMessageXmlHelper.Instance.GetPromptMessage("scanpass", EnumPromptMessage.warning));
 }
        private void OnConfirmBtnClick(object sender, EventArgs e)

        {
            if (_workFlowView != null)
            {
                string validationResult = _workFlowView.ValidateData();
                if (!string.IsNullOrEmpty(validationResult))
                {
                    _validationResullt = validationResult;
                    //MessageBox.Show(validationResult, "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                if (_workFlowView.IsCfmCloseDialog == 2)
                {
                    return;
                }
                Dictionary <string, string> parameterResult = _workFlowView.SetViewParameters();
                ScanBarCodes     = _workFlowView.ScanBarCodes;
                OutputParameters = _workFlowView.OutputParameters;

                //GetDialogGridParameters();

                DialogResultStatus = 2;
                if (_sL_parametertmp02.Count > 0 && _sL_parametersinfo.Count == 0 &&
                    parameterResult.ContainsKey("ShowParameterUI") && Boolean.Parse(parameterResult["ShowParameterUI"]))
                {
                    BarCodeHolder.Stop();
                    HCSWF_parameters_select HCSWF_parameters_select01 = new HCSWF_parameters_select(_pdcode, _sL_parametertmp02, _dtpartvalue);
                    if (HCSWF_parameters_select01.DialogResultStatus < 3)
                    {
                        HCSWF_parameters_select01.ShowDialog();
                        DialogResultStatus = HCSWF_parameters_select01.DialogResultStatus;
                        BarCodeHolder.Start(false);
                        //获取parameter_02参数的交互值
                        if (HCSWF_parameters_select01.Int_rec > -1)
                        {
                            _sL_parametertmp02 = HCSWF_parameters_select01.SL_returnparametersvalue;
                            _sL_parametersinfo = HCSWF_parameters_select01.SL_returnparametersinfo;

                            if (OutputParameters != null && !OutputParameters.ContainsKey("pd_par2"))
                            {
                                OutputParameters.Add("pd_par2", _sL_parametertmp02);
                            }
                            if (OutputParameters != null && !OutputParameters.ContainsKey("Par2_info"))
                            {
                                OutputParameters.Add("Par2_info", _sL_parametersinfo);
                            }
                            Close();
                        }
                    }
                    else
                    {
                        Close();
                    }
                }
                else
                {
                    this.Close();
                }
            }
            else
            {
                DialogResultStatus = 2;
                Close();
            }
        }