protected virtual void BarCodeScan() { try { this.tbBarCode.Text = this.tbBarCode.Text.Trim(); #region 当输入框为空时,按回车焦点跳转 if (this.tbBarCode.Text.Trim() == string.Empty && this.gvList.Rows.Count > 0) { if (this.resolver.IsScanHu || this.gvHuList.Rows.Count > 0) { this.btnConfirm.Focus(); this.gvListDataBind(); //this.gvHuList.Visible = false; //this.gvList.Visible = true; } else { this.gvList.Focus(); this.gvList.BeginEdit(true); } return; } if (this.tbBarCode.Text.Trim() == string.Empty) { return; } #endregion this.resolver.Input = this.tbBarCode.Text; if (this.enableCache) { this.originalResolver = Utility.ProcessOriginalResolver(this.resolver, this.originalResolver); this.originalResolver = TheClientMgr.ScanBarcode(this.originalResolver); this.resolver = Utility.MergeResolver(this.resolver, this.originalResolver); } else { this.resolver = TheClientMgr.ScanBarcode(this.resolver); } this.DataBind(); } catch (FaultException ex) { string messageText = Utility.FormatExMessage(ex.Message); this.lblMessage.Text = messageText; MessageBox.Show(this, messageText); this.DataBind(); } catch (Exception ex) { MessageBox.Show(this, ex.Message, "程序内部错误,请与管理员联系", MessageBoxButtons.OK, MessageBoxIcon.Error); InitialAll(); } }