Browse Source

自动升级完善。备货调整。发货调整。

master
yibo 7 years ago
parent
commit
86e43122ed
6 changed files with 130 additions and 95 deletions
  1. +20
    -3
      ButcherFactory.AutoUpdate/Form1.cs
  2. +6
    -6
      ButcherFactory.BO/LocalBL/CarcassSaleOutBL.cs
  3. +14
    -19
      ButcherFactory.BO/LocalBL/SegmentSaleOutBL.cs
  4. +70
    -65
      ButcherFactory.Form/SegmentStockUp_/SegmentStockUpForm.Designer.cs
  5. +1
    -1
      ButcherFactory.Form/SegmentStockUp_/SegmentStockUpForm.cs
  6. +19
    -1
      ButcherFactory.Form/SegmentStockUp_/SegmentStockUpPrint.cs

+ 20
- 3
ButcherFactory.AutoUpdate/Form1.cs View File

@ -90,7 +90,8 @@ namespace ButcherFactory.AutoUpdate
clientDownload.DownloadFileCompleted += new AsyncCompletedEventHandler(OnDownloadFileCompleted); clientDownload.DownloadFileCompleted += new AsyncCompletedEventHandler(OnDownloadFileCompleted);
evtPerDonwload.Reset(); 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); clientDownload.DownloadFileAsync(new Uri(file.Url), Path.Combine(AppDomain.CurrentDomain.BaseDirectory, file.FileName + ".tmp"), file);
//等待下载完成 //等待下载完成
@ -108,7 +109,7 @@ namespace ButcherFactory.AutoUpdate
Exit(true); Exit(true);
evtDownload.Set(); evtDownload.Set();
XmlUtil.SerializerObjToFile(old); XmlUtil.SerializerObjToFile(old);
Process.Start(Path.Combine(Application.StartupPath, startFile));
Process.Start(Path.Combine(Application.StartupPath, startFile), "true");
Application.Exit(); Application.Exit();
} }
else else
@ -129,7 +130,10 @@ namespace ButcherFactory.AutoUpdate
{ {
if (File.Exists(oldFile)) if (File.Exists(oldFile))
File.Delete(oldFile); File.Delete(oldFile);
else if (file.FileName.Contains("/"))
{
CreateDeepFolder(oldFolder, file.FileName);
}
File.Move(filePath, oldFile); File.Move(filePath, oldFile);
} }
@ -138,6 +142,19 @@ namespace ButcherFactory.AutoUpdate
evtPerDonwload.Set(); 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) void OnDownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)
{ {
this.SetProcessBar(e.ProgressPercentage, (int)((nDownloadedTotal + e.BytesReceived) * 100 / total)); this.SetProcessBar(e.ProgressPercentage, (int)((nDownloadedTotal + e.BytesReceived) * 100 / total));


+ 6
- 6
ButcherFactory.BO/LocalBL/CarcassSaleOutBL.cs View File

@ -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 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<string>(RpcPath + "SaleOutStoreRpc/SaveWeightRecord", JsonConvert.SerializeObject(arr), detail.ID); var json = RpcFacade.Call<string>(RpcPath + "SaleOutStoreRpc/SaveWeightRecord", JsonConvert.SerializeObject(arr), detail.ID);
var back = JsonConvert.DeserializeObject<List<ExtensionObj>>(json);
var back = JsonConvert.DeserializeObject<Tuple<decimal?, decimal?, List<ExtensionObj>>>(json);
using (var session = DmoSession.New()) using (var session = DmoSession.New())
{ {
foreach (var item in details) 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<string, object>("BillID", detail.SaleOutStore_ID), Update(session, item.ID, new Tuple<string, object>("BillID", detail.SaleOutStore_ID),
new Tuple<string, object>("DetailID", detail.ID), new Tuple<string, object>("DetailID", detail.ID),
@ -213,8 +213,8 @@ namespace ButcherFactory.BO.LocalBL
} }
session.Commit(); 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) public static void SetGoodsFinish(long id)
@ -241,9 +241,9 @@ namespace ButcherFactory.BO.LocalBL
session.Insert(detail); session.Insert(detail);
var arr = new List<WeightRecord> { new WeightRecord { Flag = flag, ID = detail.ID, WeightTime = detail.Time, MainUnitNum = detail.Weight, SecondNumber = detail.Number } }; var arr = new List<WeightRecord> { new WeightRecord { Flag = flag, ID = detail.ID, WeightTime = detail.Time, MainUnitNum = detail.Weight, SecondNumber = detail.Number } };
var json = RpcFacade.Call<string>(RpcPath + "SaleOutStoreRpc/SaveWeightRecord", JsonConvert.SerializeObject(arr), detail.DetailID); var json = RpcFacade.Call<string>(RpcPath + "SaleOutStoreRpc/SaveWeightRecord", JsonConvert.SerializeObject(arr), detail.DetailID);
var back = JsonConvert.DeserializeObject<List<ExtensionObj>>(json);
var back = JsonConvert.DeserializeObject<Tuple<decimal?, decimal?, List<ExtensionObj>>>(json);
var first = back.First();
var first = back.Item3.First();
Update(session, detail.ID, new Tuple<string, object>("WeightRecord_ID", first.LongExt2), Update(session, detail.ID, new Tuple<string, object>("WeightRecord_ID", first.LongExt2),
new Tuple<string, object>("ScanRecord_ID", first.LongExt3) new Tuple<string, object>("ScanRecord_ID", first.LongExt3)


+ 14
- 19
ButcherFactory.BO/LocalBL/SegmentSaleOutBL.cs View File

@ -62,23 +62,19 @@ namespace ButcherFactory.BO.LocalBL
return CarcassSaleOutBL.GetBatchFromEMS(1); return CarcassSaleOutBL.GetBatchFromEMS(1);
} }
static void SubmitDetails(IEnumerable<SegmentSaleOut_Detail> details, SaleOutStore_Detail detail, int flag)
static void SubmitDetails(IDmoSession session, IEnumerable<SegmentSaleOut_Detail> 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 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<string>(RpcPath + "SaleOutStoreRpc/SaveWeightRecord", JsonConvert.SerializeObject(arr), detail.ID); var json = RpcFacade.Call<string>(RpcPath + "SaleOutStoreRpc/SaveWeightRecord", JsonConvert.SerializeObject(arr), detail.ID);
var back = JsonConvert.DeserializeObject<List<ExtensionObj>>(json);
using (var session = DmoSession.New())
var back = JsonConvert.DeserializeObject<Tuple<decimal?, decimal?, List<ExtensionObj>>>(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<string, object>("WeightRecord_ID", first.LongExt2),
new Tuple<string, object>("ScanRecord_ID", first.LongExt3)
);
}
session.Commit();
var first = back.Item3.First(x => x.LongExt1 == item.ID);
Update(session, item.ID,
new Tuple<string, object>("WeightRecord_ID", first.LongExt2),
new Tuple<string, object>("ScanRecord_ID", first.LongExt3)
);
} }
} }
@ -115,9 +111,9 @@ namespace ButcherFactory.BO.LocalBL
session.Insert(detail); session.Insert(detail);
var arr = new List<WeightRecord> { new WeightRecord { Flag = 2, ID = detail.ID, WeightTime = detail.Time, MainUnitNum = detail.Number, SecondNumber = detail.SecondNumber } }; var arr = new List<WeightRecord> { new WeightRecord { Flag = 2, ID = detail.ID, WeightTime = detail.Time, MainUnitNum = detail.Number, SecondNumber = detail.SecondNumber } };
var json = RpcFacade.Call<string>(RpcPath + "SaleOutStoreRpc/SaveWeightRecord", JsonConvert.SerializeObject(arr), detail.DetailID); var json = RpcFacade.Call<string>(RpcPath + "SaleOutStoreRpc/SaveWeightRecord", JsonConvert.SerializeObject(arr), detail.DetailID);
var back = JsonConvert.DeserializeObject<List<ExtensionObj>>(json);
var back = JsonConvert.DeserializeObject<Tuple<decimal?, decimal?, List<ExtensionObj>>>(json);
var first = back.First();
var first = back.Item3.First();
Update(session, detail.ID, new Tuple<string, object>("WeightRecord_ID", first.LongExt2), Update(session, detail.ID, new Tuple<string, object>("WeightRecord_ID", first.LongExt2),
new Tuple<string, object>("ScanRecord_ID", first.LongExt3) new Tuple<string, object>("ScanRecord_ID", first.LongExt3)
@ -152,10 +148,10 @@ namespace ButcherFactory.BO.LocalBL
using (var session = DmoSession.New()) using (var session = DmoSession.New())
{ {
session.Insert(detail); session.Insert(detail);
SubmitDetails(session, new SegmentSaleOut_Detail[] { detail }, orderDetail, 1);
session.Commit(); session.Commit();
} }
SubmitDetails(new SegmentSaleOut_Detail[] { detail }, orderDetail, 1);
} }
public static void InsertReadWeight(SaleOutStore_Detail orderDetail, SegmentSaleOut_Detail detail) public static void InsertReadWeight(SaleOutStore_Detail orderDetail, SegmentSaleOut_Detail detail)
@ -171,10 +167,9 @@ namespace ButcherFactory.BO.LocalBL
using (var session = DmoSession.New()) using (var session = DmoSession.New())
{ {
session.Insert(detail); session.Insert(detail);
SubmitDetails(session, new SegmentSaleOut_Detail[] { detail }, orderDetail, 2);
session.Commit(); session.Commit();
} }
SubmitDetails(new SegmentSaleOut_Detail[] { detail }, orderDetail, 2);
} }
public static bool BarCodeUsed(string barCode) public static bool BarCodeUsed(string barCode)


+ 70
- 65
ButcherFactory.Form/SegmentStockUp_/SegmentStockUpForm.Designer.cs View File

@ -65,12 +65,6 @@
this.panel6 = new System.Windows.Forms.Panel(); this.panel6 = new System.Windows.Forms.Panel();
this.label13 = new System.Windows.Forms.Label(); this.label13 = new System.Windows.Forms.Label();
this.detailGridView = new WinFormControl.UDataGridView(); 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.dhUnitNumLbl = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label(); this.label7 = new System.Windows.Forms.Label();
this.bhUnitNumLbl = new System.Windows.Forms.Label(); this.bhUnitNumLbl = new System.Windows.Forms.Label();
@ -80,6 +74,12 @@
this.panel7 = new System.Windows.Forms.Panel(); this.panel7 = new System.Windows.Forms.Panel();
this.printCk = new System.Windows.Forms.CheckBox(); this.printCk = new System.Windows.Forms.CheckBox();
this.refresh = new ButcherFactory.Controls.ColorButton(); 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.roundPanel1.SuspendLayout();
this.panel5.SuspendLayout(); this.panel5.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.mainGridView)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.mainGridView)).BeginInit();
@ -291,12 +291,13 @@
this.D_DeliverGoodsLine_Name.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; this.D_DeliverGoodsLine_Name.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.D_DeliverGoodsLine_Name.DataPropertyName = "DeliverGoodsLine_Name"; this.D_DeliverGoodsLine_Name.DataPropertyName = "DeliverGoodsLine_Name";
this.D_DeliverGoodsLine_Name.HeaderText = "线路名称"; this.D_DeliverGoodsLine_Name.HeaderText = "线路名称";
this.D_DeliverGoodsLine_Name.MinimumWidth = 100;
this.D_DeliverGoodsLine_Name.Name = "D_DeliverGoodsLine_Name"; this.D_DeliverGoodsLine_Name.Name = "D_DeliverGoodsLine_Name";
this.D_DeliverGoodsLine_Name.ReadOnly = true; this.D_DeliverGoodsLine_Name.ReadOnly = true;
// //
// D_Goods_Name // 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.DataPropertyName = "Goods_Name";
this.D_Goods_Name.HeaderText = "产品名称"; this.D_Goods_Name.HeaderText = "产品名称";
this.D_Goods_Name.MinimumWidth = 100; this.D_Goods_Name.MinimumWidth = 100;
@ -305,13 +306,12 @@
// //
// D_Goods_Spec // D_Goods_Spec
// //
this.D_Goods_Spec.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
this.D_Goods_Spec.DataPropertyName = "Goods_Spec"; this.D_Goods_Spec.DataPropertyName = "Goods_Spec";
this.D_Goods_Spec.HeaderText = "规格"; 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.Name = "D_Goods_Spec";
this.D_Goods_Spec.ReadOnly = true; this.D_Goods_Spec.ReadOnly = true;
this.D_Goods_Spec.Width = 90;
this.D_Goods_Spec.Width = 70;
// //
// D_SecondNumber // D_SecondNumber
// //
@ -321,6 +321,7 @@
this.D_SecondNumber.HeaderText = "订货数量"; this.D_SecondNumber.HeaderText = "订货数量";
this.D_SecondNumber.Name = "D_SecondNumber"; this.D_SecondNumber.Name = "D_SecondNumber";
this.D_SecondNumber.ReadOnly = true; this.D_SecondNumber.ReadOnly = true;
this.D_SecondNumber.Width = 90;
// //
// D_UnitNum // D_UnitNum
// //
@ -330,6 +331,7 @@
this.D_UnitNum.HeaderText = "订货重量"; this.D_UnitNum.HeaderText = "订货重量";
this.D_UnitNum.Name = "D_UnitNum"; this.D_UnitNum.Name = "D_UnitNum";
this.D_UnitNum.ReadOnly = true; this.D_UnitNum.ReadOnly = true;
this.D_UnitNum.Width = 90;
// //
// D_SSecondNumber // D_SSecondNumber
// //
@ -339,6 +341,7 @@
this.D_SSecondNumber.HeaderText = "备货数量"; this.D_SSecondNumber.HeaderText = "备货数量";
this.D_SSecondNumber.Name = "D_SSecondNumber"; this.D_SSecondNumber.Name = "D_SSecondNumber";
this.D_SSecondNumber.ReadOnly = true; this.D_SSecondNumber.ReadOnly = true;
this.D_SSecondNumber.Width = 90;
// //
// D_SUnitNum // D_SUnitNum
// //
@ -348,6 +351,7 @@
this.D_SUnitNum.HeaderText = "备货重量"; this.D_SUnitNum.HeaderText = "备货重量";
this.D_SUnitNum.Name = "D_SUnitNum"; this.D_SUnitNum.Name = "D_SUnitNum";
this.D_SUnitNum.ReadOnly = true; this.D_SUnitNum.ReadOnly = true;
this.D_SUnitNum.Width = 90;
// //
// label12 // label12
// //
@ -428,60 +432,6 @@
this.detailGridView.Size = new System.Drawing.Size(580, 320); this.detailGridView.Size = new System.Drawing.Size(580, 320);
this.detailGridView.TabIndex = 6; 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 // dhUnitNumLbl
// //
this.dhUnitNumLbl.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.dhUnitNumLbl.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
@ -547,6 +497,7 @@
// //
// panel7 // 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.printCk);
this.panel7.Controls.Add(this.refresh); this.panel7.Controls.Add(this.refresh);
this.panel7.Location = new System.Drawing.Point(824, 5); this.panel7.Location = new System.Drawing.Point(824, 5);
@ -578,6 +529,60 @@
this.refresh.UseVisualStyleBackColor = false; this.refresh.UseVisualStyleBackColor = false;
this.refresh.Click += new System.EventHandler(this.refresh_Click); 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 // SegmentStockUpForm
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@ -626,6 +631,7 @@
private System.Windows.Forms.Label label7; private System.Windows.Forms.Label label7;
private System.Windows.Forms.Panel panel7; private System.Windows.Forms.Panel panel7;
private Controls.ColorButton refresh; private Controls.ColorButton refresh;
private System.Windows.Forms.CheckBox printCk;
private System.Windows.Forms.DataGridViewTextBoxColumn D_DeliverGoodsLine_ID; private System.Windows.Forms.DataGridViewTextBoxColumn D_DeliverGoodsLine_ID;
private System.Windows.Forms.DataGridViewTextBoxColumn D_Goods_ID; private System.Windows.Forms.DataGridViewTextBoxColumn D_Goods_ID;
private System.Windows.Forms.DataGridViewTextBoxColumn D_Date; private System.Windows.Forms.DataGridViewTextBoxColumn D_Date;
@ -643,6 +649,5 @@
private System.Windows.Forms.DataGridViewTextBoxColumn B_SaleOutStoreID; private System.Windows.Forms.DataGridViewTextBoxColumn B_SaleOutStoreID;
private System.Windows.Forms.DataGridViewTextBoxColumn B_SecondNumber; private System.Windows.Forms.DataGridViewTextBoxColumn B_SecondNumber;
private System.Windows.Forms.DataGridViewTextBoxColumn B_UnitNumber; private System.Windows.Forms.DataGridViewTextBoxColumn B_UnitNumber;
private System.Windows.Forms.CheckBox printCk;
} }
} }

+ 1
- 1
ButcherFactory.Form/SegmentStockUp_/SegmentStockUpForm.cs View File

@ -110,9 +110,9 @@ namespace ButcherFactory.SegmentStockUp_
allDetail.Add(detail); allDetail.Add(detail);
first.SSecondNumber = (first.SSecondNumber ?? 0) + (detail.SecondNumber ?? 0); first.SSecondNumber = (first.SSecondNumber ?? 0) + (detail.SecondNumber ?? 0);
first.SUnitNum = (first.SUnitNum ?? 0) + (detail.UnitNumber ?? 0); first.SUnitNum = (first.SUnitNum ?? 0) + (detail.UnitNumber ?? 0);
BindMainGrid(sendTime, first.Goods_ID);
if (printCk.Checked) if (printCk.Checked)
SegmentStockUpPrint.Print(detail, customer); SegmentStockUpPrint.Print(detail, customer);
BindMainGrid(sendTime, first.Goods_ID);
} }
void FillAllDetail(DateTime date, long driverLineID, long goodsID) void FillAllDetail(DateTime date, long driverLineID, long goodsID)


+ 19
- 1
ButcherFactory.Form/SegmentStockUp_/SegmentStockUpPrint.cs View File

@ -22,11 +22,29 @@ namespace ButcherFactory.SegmentStockUp_
// BwpClientPrint.BwpClientWebPrint.Print(PRINTFILE, dic); // 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) public static void Print(StockUpDetail entity, string customer)
{ {
var templateString = File.ReadAllText("PrintTemplate\\SegmentStockUpPrint.txt", Encoding.UTF8); 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(); var printName = GetZebraPrintName();


Loading…
Cancel
Save