/// <summary> /// 扫描条码 /// </summary> private void ScanBarCode() { try { tabOrderManager.Reset(); string barcode = txtBarCode.Text.Trim(); if (string.IsNullOrEmpty(barcode)) { return; } BarCodeInfoDTO dto = ServiceAgent.Agent.QueryBarCodeInfo(PDAContext.LoginOrgID, barcode); mainInvCheckRow = dataSet.InvCheckBarCode.AddNewRow(dto); if (mainInvCheckRow == null) { throw new PDAException(txtBarCode, "没有找到该条形码的料品信息!"); } // 料品信息 txtInfo.Text = mainInvCheckRow.ToString(); // 显示行数 ShowRowCount(); // 焦点定位到最后一行 this.dataGrid1.Focus(); this.dataGrid1.CurrentRowIndex = this.dataSet.InvCheckBarCode.Count - 1; // 跳转到下一个控件 tabOrderManager.Next(); } catch (Exception ex) { MessageBox.Show(ExceptionParser.ParseError(ex)); tabOrderManager.DealException(ex); } }
/// <summary> /// 初始化界面 /// </summary> private void ClearData() { InitUI(); dataSet.InvCheckBarCode.Clear(); mainInvCheckRow = null; }