コード例 #1
0
        public ControlViewBase GeneratorWFDialog(string pdCode)
        {
            ControlViewBase viewBase = null;

            try
            {
                SortedList condition = new SortedList();
                //condition.Add(1, CnasBaseData.SystemID);
                condition.Add(1, pdCode);
                CnasRemotCall remoteCall = new CnasRemotCall();
                string        testSql    = remoteCall.RemotInterface.CheckSelectData("HCS-procedure-dialog-sec001", condition);
                DataTable     data       = remoteCall.RemotInterface.SelectData("HCS-procedure-dialog-sec001", condition);
                if (data != null && data.Rows.Count > 0 && data.Columns.Contains("assembly") &&
                    data.Columns.Contains("fullName") && data.Columns.Contains("isLoad"))
                {
                    string assemblyName = data.Rows[0]["assembly"].ToString();
                    string fullName     = data.Rows[0]["fullName"].ToString();
                    viewBase         = Assembly.Load(assemblyName).CreateInstance(fullName) as ControlViewBase;
                    viewBase.IsShown = data.Rows[0]["isLoad"].ToString() == "1";
                    //Boolean.TryParse(data.Rows[0]["isLoad"].ToString(), out viewBase.IsShown);
                }
                else
                {
                    Logger.Info(string.Format("Dialog does not set for the Workflow. Wf_code:{0}.", pdCode));
                }
            }
            catch (Exception ex)
            {
                Logger.Error(string.Format("Generate form exception errorMessage: {0}.", ex.Message));
            }
            return(viewBase);
        }
コード例 #2
0
        public HCSWF_dialog_container(SortedList scanCodes, SortedList sl_Check, CnasHCSWorkflowInterface workflowServer, string pd_code, SortedList sL_parametertmp02, DataTable dtpartvalue, SortedList sL_parametersinfo)
            : base(scanCodes)

        {
            _sl_Check          = sl_Check;
            _sL_parametertmp02 = sL_parametertmp02;
            _pdcode            = pd_code;
            _sL_parametersinfo = sL_parametersinfo;
            _dtpartvalue       = dtpartvalue;
            Logger             = Logger ?? LogManager.GetLogger("CnasWNSClient");

            InitializeComponent();
            ControlViewBase viewBase = WorkFlowDialogGenerator.Instance.GeneratorWFDialog(PdCode);

            if (viewBase != null)
            {
                _workFlowView          = viewBase;
                DialogResultStatus     = viewBase.IsShown ? 1 : 0;
                _workFlowView.Sl_check = this._sl_Check;
                _workFlowView.Dock     = DockStyle.Fill;
                infoPanel.Controls.Add(viewBase);
                infoPanel.SetRow(viewBase, 0);
                _workFlowView.PdCode         = PdCode;
                _workFlowView.ScanBarCodes   = ScanBarCodes;
                _workFlowView.WorkflowServer = workflowServer as WorkflowArithmeticClass;
                if (ViewData.ContainsKey("UserInfo") && ViewData["UserInfo"] is UserBase)
                {
                    viewBase.UserInfo = ViewData["UserInfo"] as UserBase;
                }
                else
                {
                    UserBase userInfo = UserBaseHelper.GetUserByBarCode(BarCodeHelper.GetBarCodeByType("BCB", ScanBarCodes));
                    if (userInfo != null)
                    {
                        ViewData.Add("UserInfo", userInfo);
                        viewBase.UserInfo = userInfo;
                    }
                    else
                    {
                        Logger.Error(string.Format("Can not get user info. User barCode:{0}", BarCodeHelper.GetBarCodeByType("BCB", ScanBarCodes)));
                    }
                }
                MinimumSize = new Size((int)(_workFlowView.Width + mainPanel.ColumnStyles[1].Width + 100),
                                       viewBase.Height + 180);
            }
            else
            {
                DialogResultStatus = 0;
            }
            confirmBtn.Height  = buttonGroup.ItemHeight - 3;
            buttonPanel.Height = confirmBtn.Margin.Top + confirmBtn.Margin.Bottom + confirmBtn.Height * 2 +
                                 cancelBtn.Margin.Top + cancelBtn.Margin.Bottom;
            cancelBtn.Height           = confirmBtn.Height;
            confirmBtn.BackgroundImage = BarCodeHelper.GetBarcodeImage(_okBarCode, "确  认", confirmBtn.Width, confirmBtn.Height);
            cancelBtn.BackgroundImage  = BarCodeHelper.GetBarcodeImage(_closeBarCode, "关  闭", cancelBtn.Width, cancelBtn.Height);
        }