From 4998c6dbc39a3f393aca569d6182cddd6bdd5e1d Mon Sep 17 00:00:00 2001 From: yibo <361071264@qq.com> Date: Sat, 9 Jan 2021 18:58:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SegmentProduction_/SegmentProductionPrint.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint.cs b/ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint.cs index 6ebe800..11ec8c1 100644 --- a/ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint.cs +++ b/ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint.cs @@ -42,7 +42,16 @@ namespace ButcherFactory.SegmentProduction_ dic.Add("$ImageUrl", imgUrl); var barImgUrl = string.Format(IMGFILE, id + "_bar"); - BwpClientPrint.BwpClientWebPrint.CreateBarCode("69212203" + entity.Goods_Code, barImgUrl, new Size(120, 40)); + try + { + BwpClientPrint.BwpClientWebPrint.CreateBarCode("69212203" + entity.Goods_Code, barImgUrl, new Size(120, 40)); + } + catch (Exception ex){ + if (ex.Message == "Contents do not pass checksum") + { + BwpClientPrint.BwpClientWebPrint.CreateBarCode("69738841" + entity.Goods_Code, barImgUrl, new Size(120, 40)); + } + } dic.Add("$BarImg", barImgUrl); string unit = entity.MainUnit; int rate =1;