//调用远端接口,判断条码类型,是储位编号还是物料条码 private bool CheckBarcode(string barcode, ref int type) { try { int result = DBPCaller.CheckBarcode(barcode); Trace.WriteLine("Debug: CheckBarcode return " + result); if (result == 1 /*储位编号*/ || result == 3 /*TR_SN*/) { type = result; return(true); } else if (result == 2) { ShowHint("扫入的是周转箱编号,请扫描正确的条码!", Color.Red); } else if (result == 4) { ShowHint("扫入的是出库单号,请扫描正确的条码!", Color.Red); } else if (result == 5) { ShowHint("扫入的是入库单号,请扫描正确的条码!", Color.Red); } else { ShowHint("未知条码,请扫正确的条码", Color.Red); } return(false); } catch (Exception ex) { Log.Error("CheckBarcode: " + ex.Message); ShowHint("CheckBarcode: " + ex.Message, Color.Red); return(false); } }
//调用远端接口,判断条码类型,是储位编号还是物料条码 private bool CheckBarcode(string barcode, ref int type) { try { int result = DBPCaller.CheckBarcode(barcode); if (result == 1 /*储位编号*/ || result == 2 /*周转箱*/) { type = result; return(true); } else if (result == 3) { ShowHint("扫入的是物料唯一条码,请扫正确的条码!", Color.Red); } else if (result == 4) { ShowHint("扫入的是出库单号,请扫描正确的条码!", Color.Red); } else if (result == 5) { ShowHint("扫入的是入库单号,请扫描正确的条码!", Color.Red); } else { ShowHint("未知条码,请扫正确的条码", Color.Red); } return(false); } catch (Exception ex) { Log.Error("CheckBarcode: " + ex.Message); ShowHint("CheckBarcode: " + ex.Message, Color.Red); return(false); } }