/// <summary> /// 耗材扫描 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void barcodeScanner1_BarcodeScanned(object sender, BarcodeResultArgs e) { try { string locId = e.Value; locData = locId.Split('/'); if (locData.Length != 3) { throw new Exception("库位条码错误"); } WHStorageLocationOutputDto sloc = _autofacConfig.wareHouseService.GetSLByID(locData[0], locData[1], locData[2]); if (sloc == null) { throw new Exception("该库位不存在"); } List <ConInventoryResult> resultList = _autofacConfig.ConInventoryService.GetResultListBySL(IID, locData[0], locData[1], locData[2]); if (resultList.Count == 0) { throw new Exception("该库位下无可盘点耗材"); } frmCIResultTotalLayout frm = new frmCIResultTotalLayout(); frm.lblSL.Text = sloc.WARENAME + "/" + sloc.STNAME + "/" + sloc.SLNAME; Form.ShowDialog(frm); } catch (Exception ex) { Toast(ex.Message); } }
/// <summary> /// 耗材扫描 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void barcodeScanner1_BarcodeScanned(object sender, BarcodeResultArgs e) { try { string CID = e.Value.ToUpper(); var con = _autofacConfig.consumablesService.GetConsById(CID); String STID = (lblST.Tag == null) ? null : lblST.Tag.ToString(); String SLID = (lblSL.Tag == null) ? null : lblSL.Tag.ToString(); if (con != null) { ConInventoryResult result = _autofacConfig.ConInventoryService.GetResultByCID(IID, CID); if (result != null) { if (result.RESULT.ToString() != "0") { throw new Exception("该耗材已盘点完毕,请勿重复盘点!"); } frmCIResultTotalLayout frm = new frmCIResultTotalLayout(); ConQuant conq = _autofacConfig.consumablesService.GetQuants(lblWareHouse.Tag.ToString(), STID, SLID, CID); frm.lblNumber.Text = conq.QUANTITY.ToString(); frm.CID = CID; Form.ShowDialog(frm); } else //盘盈 { frmCIResultTotalLayout frm = new frmCIResultTotalLayout(); ConQuant conq = _autofacConfig.consumablesService.GetQuants(lblWareHouse.Tag.ToString(), STID, SLID, CID); frm.plNumber.Visible = false; frm.Height = 120; frm.CID = CID; Form.ShowDialog(frm); } } else { Toast("未找到对应的耗材!"); } } catch (Exception ex) { Toast(ex.Message); } }