From 86e43122ed787d9493ca7189f87614d0edd6670e Mon Sep 17 00:00:00 2001 From: yibo <361071264@qq.com> Date: Mon, 10 Sep 2018 15:03:14 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=8D=87=E7=BA=A7=E5=AE=8C?= =?UTF-8?q?=E5=96=84=E3=80=82=E5=A4=87=E8=B4=A7=E8=B0=83=E6=95=B4=E3=80=82?= =?UTF-8?q?=E5=8F=91=E8=B4=A7=E8=B0=83=E6=95=B4=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ButcherFactory.AutoUpdate/Form1.cs | 23 ++- ButcherFactory.BO/LocalBL/CarcassSaleOutBL.cs | 12 +- ButcherFactory.BO/LocalBL/SegmentSaleOutBL.cs | 33 ++--- .../SegmentStockUpForm.Designer.cs | 135 +++++++++--------- .../SegmentStockUp_/SegmentStockUpForm.cs | 2 +- .../SegmentStockUp_/SegmentStockUpPrint.cs | 20 ++- 6 files changed, 130 insertions(+), 95 deletions(-) diff --git a/ButcherFactory.AutoUpdate/Form1.cs b/ButcherFactory.AutoUpdate/Form1.cs index 23b6427..bda7923 100644 --- a/ButcherFactory.AutoUpdate/Form1.cs +++ b/ButcherFactory.AutoUpdate/Form1.cs @@ -90,7 +90,8 @@ namespace ButcherFactory.AutoUpdate clientDownload.DownloadFileCompleted += new AsyncCompletedEventHandler(OnDownloadFileCompleted); evtPerDonwload.Reset(); - + if (file.FileName.Contains("/")) + CreateDeepFolder(AppDomain.CurrentDomain.BaseDirectory, file.FileName); clientDownload.DownloadFileAsync(new Uri(file.Url), Path.Combine(AppDomain.CurrentDomain.BaseDirectory, file.FileName + ".tmp"), file); //等待下载完成 @@ -108,7 +109,7 @@ namespace ButcherFactory.AutoUpdate Exit(true); evtDownload.Set(); XmlUtil.SerializerObjToFile(old); - Process.Start(Path.Combine(Application.StartupPath, startFile)); + Process.Start(Path.Combine(Application.StartupPath, startFile), "true"); Application.Exit(); } else @@ -129,7 +130,10 @@ namespace ButcherFactory.AutoUpdate { if (File.Exists(oldFile)) File.Delete(oldFile); - + else if (file.FileName.Contains("/")) + { + CreateDeepFolder(oldFolder, file.FileName); + } File.Move(filePath, oldFile); } @@ -138,6 +142,19 @@ namespace ButcherFactory.AutoUpdate evtPerDonwload.Set(); } + void CreateDeepFolder(string baseFolder,string fileName) + { + var idx = fileName.IndexOf(@"/"); + if (idx == -1) + return; + var folder = fileName.Substring(0, idx); + baseFolder = Path.Combine(baseFolder, folder); + if (!Directory.Exists(baseFolder)) + Directory.CreateDirectory(baseFolder); + fileName = fileName.Substring(idx + 1); + CreateDeepFolder(baseFolder, fileName); + } + void OnDownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e) { this.SetProcessBar(e.ProgressPercentage, (int)((nDownloadedTotal + e.BytesReceived) * 100 / total)); diff --git a/ButcherFactory.BO/LocalBL/CarcassSaleOutBL.cs b/ButcherFactory.BO/LocalBL/CarcassSaleOutBL.cs index 4838f1b..5bf55c9 100644 --- a/ButcherFactory.BO/LocalBL/CarcassSaleOutBL.cs +++ b/ButcherFactory.BO/LocalBL/CarcassSaleOutBL.cs @@ -198,12 +198,12 @@ namespace ButcherFactory.BO.LocalBL { var arr = details.Select(x => new WeightRecord { Flag = (!string.IsNullOrEmpty(x.BarCode) && x.BarCode.StartsWith("P")) ? -1 : 0, ID = x.ID, WeightTime = x.Time, MainUnitNum = x.Weight, SecondNumber = x.Number, ProductBatch_ID = x.ProductBatch_ID, BarCode = x.BarCode }); var json = RpcFacade.Call(RpcPath + "SaleOutStoreRpc/SaveWeightRecord", JsonConvert.SerializeObject(arr), detail.ID); - var back = JsonConvert.DeserializeObject>(json); + var back = JsonConvert.DeserializeObject>>(json); using (var session = DmoSession.New()) { foreach (var item in details) { - var first = back.First(x => x.LongExt1 == item.ID); + var first = back.Item3.First(x => x.LongExt1 == item.ID); Update(session, item.ID, new Tuple("BillID", detail.SaleOutStore_ID), new Tuple("DetailID", detail.ID), @@ -213,8 +213,8 @@ namespace ButcherFactory.BO.LocalBL } session.Commit(); } - detail.SNumber = (detail.SNumber ?? 0) + details.Sum(x => x.Weight); - detail.SSecondNumber = (detail.SSecondNumber ?? 0) + details.Sum(x => x.Number); + detail.SNumber = back.Item1; + detail.SSecondNumber = back.Item2; } public static void SetGoodsFinish(long id) @@ -241,9 +241,9 @@ namespace ButcherFactory.BO.LocalBL session.Insert(detail); var arr = new List { new WeightRecord { Flag = flag, ID = detail.ID, WeightTime = detail.Time, MainUnitNum = detail.Weight, SecondNumber = detail.Number } }; var json = RpcFacade.Call(RpcPath + "SaleOutStoreRpc/SaveWeightRecord", JsonConvert.SerializeObject(arr), detail.DetailID); - var back = JsonConvert.DeserializeObject>(json); + var back = JsonConvert.DeserializeObject>>(json); - var first = back.First(); + var first = back.Item3.First(); Update(session, detail.ID, new Tuple("WeightRecord_ID", first.LongExt2), new Tuple("ScanRecord_ID", first.LongExt3) diff --git a/ButcherFactory.BO/LocalBL/SegmentSaleOutBL.cs b/ButcherFactory.BO/LocalBL/SegmentSaleOutBL.cs index 4c1982f..d74032a 100644 --- a/ButcherFactory.BO/LocalBL/SegmentSaleOutBL.cs +++ b/ButcherFactory.BO/LocalBL/SegmentSaleOutBL.cs @@ -62,23 +62,19 @@ namespace ButcherFactory.BO.LocalBL return CarcassSaleOutBL.GetBatchFromEMS(1); } - static void SubmitDetails(IEnumerable details, SaleOutStore_Detail detail, int flag) + static void SubmitDetails(IDmoSession session, IEnumerable details, SaleOutStore_Detail detail, int flag) { var arr = details.Select(x => new WeightRecord { Flag = flag, ID = x.ID, WeightTime = x.Time, MainUnitNum = x.Number, SecondNumber = x.SecondNumber, ProductBatch_ID = x.ProductBatch_ID, BarCode = x.BarCode }); var json = RpcFacade.Call(RpcPath + "SaleOutStoreRpc/SaveWeightRecord", JsonConvert.SerializeObject(arr), detail.ID); - var back = JsonConvert.DeserializeObject>(json); - using (var session = DmoSession.New()) + var back = JsonConvert.DeserializeObject>>(json); + foreach (var item in details) { - foreach (var item in details) - { - var first = back.First(x => x.LongExt1 == item.ID); - - Update(session, item.ID, - new Tuple("WeightRecord_ID", first.LongExt2), - new Tuple("ScanRecord_ID", first.LongExt3) - ); - } - session.Commit(); + var first = back.Item3.First(x => x.LongExt1 == item.ID); + + Update(session, item.ID, + new Tuple("WeightRecord_ID", first.LongExt2), + new Tuple("ScanRecord_ID", first.LongExt3) + ); } } @@ -115,9 +111,9 @@ namespace ButcherFactory.BO.LocalBL session.Insert(detail); var arr = new List { new WeightRecord { Flag = 2, ID = detail.ID, WeightTime = detail.Time, MainUnitNum = detail.Number, SecondNumber = detail.SecondNumber } }; var json = RpcFacade.Call(RpcPath + "SaleOutStoreRpc/SaveWeightRecord", JsonConvert.SerializeObject(arr), detail.DetailID); - var back = JsonConvert.DeserializeObject>(json); + var back = JsonConvert.DeserializeObject>>(json); - var first = back.First(); + var first = back.Item3.First(); Update(session, detail.ID, new Tuple("WeightRecord_ID", first.LongExt2), new Tuple("ScanRecord_ID", first.LongExt3) @@ -152,10 +148,10 @@ namespace ButcherFactory.BO.LocalBL using (var session = DmoSession.New()) { session.Insert(detail); + + SubmitDetails(session, new SegmentSaleOut_Detail[] { detail }, orderDetail, 1); session.Commit(); } - - SubmitDetails(new SegmentSaleOut_Detail[] { detail }, orderDetail, 1); } public static void InsertReadWeight(SaleOutStore_Detail orderDetail, SegmentSaleOut_Detail detail) @@ -171,10 +167,9 @@ namespace ButcherFactory.BO.LocalBL using (var session = DmoSession.New()) { session.Insert(detail); + SubmitDetails(session, new SegmentSaleOut_Detail[] { detail }, orderDetail, 2); session.Commit(); } - - SubmitDetails(new SegmentSaleOut_Detail[] { detail }, orderDetail, 2); } public static bool BarCodeUsed(string barCode) diff --git a/ButcherFactory.Form/SegmentStockUp_/SegmentStockUpForm.Designer.cs b/ButcherFactory.Form/SegmentStockUp_/SegmentStockUpForm.Designer.cs index bcb42eb..0c7f71b 100644 --- a/ButcherFactory.Form/SegmentStockUp_/SegmentStockUpForm.Designer.cs +++ b/ButcherFactory.Form/SegmentStockUp_/SegmentStockUpForm.Designer.cs @@ -65,12 +65,6 @@ this.panel6 = new System.Windows.Forms.Panel(); this.label13 = new System.Windows.Forms.Label(); this.detailGridView = new WinFormControl.UDataGridView(); - this.B_DeliverGoodsLine_Name = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.B_ShortCode = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.B_Goods_Name = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.B_SaleOutStoreID = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.B_SecondNumber = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.B_UnitNumber = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dhUnitNumLbl = new System.Windows.Forms.Label(); this.label7 = new System.Windows.Forms.Label(); this.bhUnitNumLbl = new System.Windows.Forms.Label(); @@ -80,6 +74,12 @@ this.panel7 = new System.Windows.Forms.Panel(); this.printCk = new System.Windows.Forms.CheckBox(); this.refresh = new ButcherFactory.Controls.ColorButton(); + this.B_DeliverGoodsLine_Name = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.B_ShortCode = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.B_Goods_Name = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.B_SaleOutStoreID = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.B_SecondNumber = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.B_UnitNumber = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.roundPanel1.SuspendLayout(); this.panel5.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.mainGridView)).BeginInit(); @@ -291,12 +291,13 @@ this.D_DeliverGoodsLine_Name.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; this.D_DeliverGoodsLine_Name.DataPropertyName = "DeliverGoodsLine_Name"; this.D_DeliverGoodsLine_Name.HeaderText = "线路名称"; + this.D_DeliverGoodsLine_Name.MinimumWidth = 100; this.D_DeliverGoodsLine_Name.Name = "D_DeliverGoodsLine_Name"; this.D_DeliverGoodsLine_Name.ReadOnly = true; // // D_Goods_Name // - this.D_Goods_Name.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; + this.D_Goods_Name.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; this.D_Goods_Name.DataPropertyName = "Goods_Name"; this.D_Goods_Name.HeaderText = "产品名称"; this.D_Goods_Name.MinimumWidth = 100; @@ -305,13 +306,12 @@ // // D_Goods_Spec // - this.D_Goods_Spec.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; this.D_Goods_Spec.DataPropertyName = "Goods_Spec"; this.D_Goods_Spec.HeaderText = "规格"; - this.D_Goods_Spec.MinimumWidth = 90; + this.D_Goods_Spec.MinimumWidth = 70; this.D_Goods_Spec.Name = "D_Goods_Spec"; this.D_Goods_Spec.ReadOnly = true; - this.D_Goods_Spec.Width = 90; + this.D_Goods_Spec.Width = 70; // // D_SecondNumber // @@ -321,6 +321,7 @@ this.D_SecondNumber.HeaderText = "订货数量"; this.D_SecondNumber.Name = "D_SecondNumber"; this.D_SecondNumber.ReadOnly = true; + this.D_SecondNumber.Width = 90; // // D_UnitNum // @@ -330,6 +331,7 @@ this.D_UnitNum.HeaderText = "订货重量"; this.D_UnitNum.Name = "D_UnitNum"; this.D_UnitNum.ReadOnly = true; + this.D_UnitNum.Width = 90; // // D_SSecondNumber // @@ -339,6 +341,7 @@ this.D_SSecondNumber.HeaderText = "备货数量"; this.D_SSecondNumber.Name = "D_SSecondNumber"; this.D_SSecondNumber.ReadOnly = true; + this.D_SSecondNumber.Width = 90; // // D_SUnitNum // @@ -348,6 +351,7 @@ this.D_SUnitNum.HeaderText = "备货重量"; this.D_SUnitNum.Name = "D_SUnitNum"; this.D_SUnitNum.ReadOnly = true; + this.D_SUnitNum.Width = 90; // // label12 // @@ -428,60 +432,6 @@ this.detailGridView.Size = new System.Drawing.Size(580, 320); this.detailGridView.TabIndex = 6; // - // B_DeliverGoodsLine_Name - // - this.B_DeliverGoodsLine_Name.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.B_DeliverGoodsLine_Name.DataPropertyName = "DeliverGoodsLine_Name"; - this.B_DeliverGoodsLine_Name.HeaderText = "线路名称"; - this.B_DeliverGoodsLine_Name.Name = "B_DeliverGoodsLine_Name"; - this.B_DeliverGoodsLine_Name.ReadOnly = true; - // - // B_ShortCode - // - this.B_ShortCode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; - this.B_ShortCode.DataPropertyName = "ShortCode"; - this.B_ShortCode.HeaderText = "条码"; - this.B_ShortCode.MinimumWidth = 90; - this.B_ShortCode.Name = "B_ShortCode"; - this.B_ShortCode.ReadOnly = true; - this.B_ShortCode.Width = 90; - // - // B_Goods_Name - // - this.B_Goods_Name.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; - this.B_Goods_Name.DataPropertyName = "Goods_Name"; - this.B_Goods_Name.HeaderText = "产品名称"; - this.B_Goods_Name.MinimumWidth = 100; - this.B_Goods_Name.Name = "B_Goods_Name"; - this.B_Goods_Name.ReadOnly = true; - // - // B_SaleOutStoreID - // - this.B_SaleOutStoreID.DataPropertyName = "SaleOutStoreID"; - this.B_SaleOutStoreID.HeaderText = "销售出库单"; - this.B_SaleOutStoreID.Name = "B_SaleOutStoreID"; - this.B_SaleOutStoreID.ReadOnly = true; - // - // B_SecondNumber - // - this.B_SecondNumber.DataPropertyName = "SecondNumber"; - dataGridViewCellStyle3.Format = "#0.######"; - this.B_SecondNumber.DefaultCellStyle = dataGridViewCellStyle3; - this.B_SecondNumber.HeaderText = "数量"; - this.B_SecondNumber.Name = "B_SecondNumber"; - this.B_SecondNumber.ReadOnly = true; - this.B_SecondNumber.Width = 80; - // - // B_UnitNumber - // - this.B_UnitNumber.DataPropertyName = "UnitNumber"; - dataGridViewCellStyle4.Format = "#0.######"; - this.B_UnitNumber.DefaultCellStyle = dataGridViewCellStyle4; - this.B_UnitNumber.HeaderText = "重量"; - this.B_UnitNumber.Name = "B_UnitNumber"; - this.B_UnitNumber.ReadOnly = true; - this.B_UnitNumber.Width = 80; - // // dhUnitNumLbl // this.dhUnitNumLbl.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; @@ -547,6 +497,7 @@ // // panel7 // + this.panel7.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.panel7.Controls.Add(this.printCk); this.panel7.Controls.Add(this.refresh); this.panel7.Location = new System.Drawing.Point(824, 5); @@ -578,6 +529,60 @@ this.refresh.UseVisualStyleBackColor = false; this.refresh.Click += new System.EventHandler(this.refresh_Click); // + // B_DeliverGoodsLine_Name + // + this.B_DeliverGoodsLine_Name.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.B_DeliverGoodsLine_Name.DataPropertyName = "DeliverGoodsLine_Name"; + this.B_DeliverGoodsLine_Name.HeaderText = "线路名称"; + this.B_DeliverGoodsLine_Name.MinimumWidth = 100; + this.B_DeliverGoodsLine_Name.Name = "B_DeliverGoodsLine_Name"; + this.B_DeliverGoodsLine_Name.ReadOnly = true; + // + // B_ShortCode + // + this.B_ShortCode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.B_ShortCode.DataPropertyName = "ShortCode"; + this.B_ShortCode.HeaderText = "条码"; + this.B_ShortCode.MinimumWidth = 90; + this.B_ShortCode.Name = "B_ShortCode"; + this.B_ShortCode.ReadOnly = true; + // + // B_Goods_Name + // + this.B_Goods_Name.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.B_Goods_Name.DataPropertyName = "Goods_Name"; + this.B_Goods_Name.HeaderText = "产品名称"; + this.B_Goods_Name.MinimumWidth = 100; + this.B_Goods_Name.Name = "B_Goods_Name"; + this.B_Goods_Name.ReadOnly = true; + // + // B_SaleOutStoreID + // + this.B_SaleOutStoreID.DataPropertyName = "SaleOutStoreID"; + this.B_SaleOutStoreID.HeaderText = "销售出库单"; + this.B_SaleOutStoreID.Name = "B_SaleOutStoreID"; + this.B_SaleOutStoreID.ReadOnly = true; + // + // B_SecondNumber + // + this.B_SecondNumber.DataPropertyName = "SecondNumber"; + dataGridViewCellStyle3.Format = "#0.######"; + this.B_SecondNumber.DefaultCellStyle = dataGridViewCellStyle3; + this.B_SecondNumber.HeaderText = "数量"; + this.B_SecondNumber.Name = "B_SecondNumber"; + this.B_SecondNumber.ReadOnly = true; + this.B_SecondNumber.Width = 80; + // + // B_UnitNumber + // + this.B_UnitNumber.DataPropertyName = "UnitNumber"; + dataGridViewCellStyle4.Format = "#0.######"; + this.B_UnitNumber.DefaultCellStyle = dataGridViewCellStyle4; + this.B_UnitNumber.HeaderText = "重量"; + this.B_UnitNumber.Name = "B_UnitNumber"; + this.B_UnitNumber.ReadOnly = true; + this.B_UnitNumber.Width = 80; + // // SegmentStockUpForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); @@ -626,6 +631,7 @@ private System.Windows.Forms.Label label7; private System.Windows.Forms.Panel panel7; private Controls.ColorButton refresh; + private System.Windows.Forms.CheckBox printCk; private System.Windows.Forms.DataGridViewTextBoxColumn D_DeliverGoodsLine_ID; private System.Windows.Forms.DataGridViewTextBoxColumn D_Goods_ID; private System.Windows.Forms.DataGridViewTextBoxColumn D_Date; @@ -643,6 +649,5 @@ private System.Windows.Forms.DataGridViewTextBoxColumn B_SaleOutStoreID; private System.Windows.Forms.DataGridViewTextBoxColumn B_SecondNumber; private System.Windows.Forms.DataGridViewTextBoxColumn B_UnitNumber; - private System.Windows.Forms.CheckBox printCk; } } \ No newline at end of file diff --git a/ButcherFactory.Form/SegmentStockUp_/SegmentStockUpForm.cs b/ButcherFactory.Form/SegmentStockUp_/SegmentStockUpForm.cs index c02a322..c843231 100644 --- a/ButcherFactory.Form/SegmentStockUp_/SegmentStockUpForm.cs +++ b/ButcherFactory.Form/SegmentStockUp_/SegmentStockUpForm.cs @@ -110,9 +110,9 @@ namespace ButcherFactory.SegmentStockUp_ allDetail.Add(detail); first.SSecondNumber = (first.SSecondNumber ?? 0) + (detail.SecondNumber ?? 0); first.SUnitNum = (first.SUnitNum ?? 0) + (detail.UnitNumber ?? 0); - BindMainGrid(sendTime, first.Goods_ID); if (printCk.Checked) SegmentStockUpPrint.Print(detail, customer); + BindMainGrid(sendTime, first.Goods_ID); } void FillAllDetail(DateTime date, long driverLineID, long goodsID) diff --git a/ButcherFactory.Form/SegmentStockUp_/SegmentStockUpPrint.cs b/ButcherFactory.Form/SegmentStockUp_/SegmentStockUpPrint.cs index b01360f..86b2f5b 100644 --- a/ButcherFactory.Form/SegmentStockUp_/SegmentStockUpPrint.cs +++ b/ButcherFactory.Form/SegmentStockUp_/SegmentStockUpPrint.cs @@ -22,11 +22,29 @@ namespace ButcherFactory.SegmentStockUp_ // BwpClientPrint.BwpClientWebPrint.Print(PRINTFILE, dic); //} + //public static void Print2(StockUpDetail entity, string customer) + //{ + // PrintAPI.B_GetUSBBufferLen(); + // PrintAPI.B_EnumUSB(new byte[128]); + // PrintAPI.B_CreateUSBPort(1); + + // PrintAPI.B_Prn_Text_TrueType(42, 40, 36, "宋体", 1, 900, 0, 0, 0, "C1", "客户:张三"); + // PrintAPI.B_Prn_Text_TrueType(42, 100, 36, "宋体", 1, 900, 0, 0, 0, "C2", "线路:青岛一线"); + // PrintAPI.B_Prn_Text_TrueType(42, 160, 36, "宋体", 1, 900, 0, 0, 0, "C4", string.Format("日期:{0}", entity.Date.ToString("yyyy/MM/dd"))); + + // PrintAPI.B_Prn_Barcode(42, 220, 0, "1", 3, 22, 40, 'B', entity.BarCode); + // //PrintAPI.B_Prn_Text_TrueType(173, 360, 25, "宋体", 1, 500, 0, 0, 0, "C9", entity.BarCode); + + // PrintAPI.B_Set_Direction('B'); + // PrintAPI.B_Print_Out(1); + // PrintAPI.B_ClosePrn(); + //} + public static void Print(StockUpDetail entity, string customer) { var templateString = File.ReadAllText("PrintTemplate\\SegmentStockUpPrint.txt", Encoding.UTF8); - var str = string.Format(templateString, customer, entity.DeliverGoodsLine_Name, entity.Date); + var str = string.Format(templateString, customer, entity.DeliverGoodsLine_Name, entity.Date,entity.BarCode); var printName = GetZebraPrintName();