private void searchdata(UserBase userInfo) { try { if (userInfo != null) //indata.StartsWith("BCB")) { //UserBase userInfo = UserBaseHelper.GetUserByBarCode(indata); if (userInfo.UserID > 0) { this.BeginInvoke(new Action(() => { HCSSM_scan_barcode scanCodeDialog = new HCSSM_scan_barcode(CnasHCSWorkflowInterface01, userInfo, dtpdpart, dtapppd, dtpartvalue); if (!scanCodeDialog.IsInternalError) { ScannerHook.Stop(); scanCodeDialog.ShowDialog(); ScannerHook.Start(false); GetWorkSets(); } })); } else { MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("nouser", EnumPromptMessage.warning, new string[] { userInfo.Userbcode }), "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } catch (Exception ex) { } }
private void 退出ToolStripMenuItem_Click(object sender, EventArgs e) { if (MessageBox.Show("您确定要退出系统吗?", "询问窗", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes) { InvokeController("Exit"); //方式一 if (BarCode != null) { BarCode.Stop(); } //方式二 CodeBarInput.DisabledAllCodeBarInput(); } }
private void searchdata(string indata) { //Cnas.wns.CnasMetroFramework.MetroMessageBox.Show(this, indata, "信息提示"); if (indata.StartsWith("BCB")) { UserBase userInfo = UserBaseHelper.GetUserByBarCode(indata); if (userInfo != null) { _scannerHook.Stop(); HCSSM_scan_barcode HCSSM_scanbarcode01 = new HCSSM_scan_barcode(CnasHCSWorkflowInterface01, userInfo, dtpdpart, dtapppd, dtpartvalue); if (!HCSSM_scanbarcode01.IsInternalError) { HCSSM_scanbarcode01.ShowDialog(); _scannerHook.Start(false); load_workorder(""); } } else { MessageBox.Show(PromptMessageXmlHelper.GetPromptMessage("nouser", EnumPromptMessage.error, new string[] { indata }), "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }