diff --git a/ButcherFactory.BO/BaseInfo/ClientGoodsSet.cs b/ButcherFactory.BO/BaseInfo/ClientGoodsSet.cs index 95a1fee..a7ad3e1 100644 --- a/ButcherFactory.BO/BaseInfo/ClientGoodsSet.cs +++ b/ButcherFactory.BO/BaseInfo/ClientGoodsSet.cs @@ -67,5 +67,11 @@ namespace ButcherFactory.BO [NonDmoProperty] public bool Selected { get; set; } + + [NonDmoProperty] + public IEnumerable Identify { get; set; } + + [NonDmoProperty] + public GoodsIdentify SelectedIdentify { get; set; } } } diff --git a/ButcherFactory.BO/BaseInfo/GoodsIdentify.cs b/ButcherFactory.BO/BaseInfo/GoodsIdentify.cs new file mode 100644 index 0000000..ebf1dab --- /dev/null +++ b/ButcherFactory.BO/BaseInfo/GoodsIdentify.cs @@ -0,0 +1,17 @@ +using Forks.EnterpriseServices.DomainObjects2; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ButcherFactory.BO +{ + [MapToTable("Butcher_GoodsIdentify")] + public class GoodsIdentify + { + public long Goods_ID { get; set; } + public string Identify { get; set; } + public string Remark { get; set; } + } +} diff --git a/ButcherFactory.BO/Bill/SegmentProduction.cs b/ButcherFactory.BO/Bill/SegmentProduction.cs index ae165af..fa5c00d 100644 --- a/ButcherFactory.BO/Bill/SegmentProduction.cs +++ b/ButcherFactory.BO/Bill/SegmentProduction.cs @@ -92,6 +92,8 @@ namespace ButcherFactory.BO public string ShotPrintName { get; set; } public decimal? StatisticNumber { get; set; } + public string Identify { get; set; } + public string IdentifyRemark { get; set; } } [MapToTable("Butcher_SegmentLog")] diff --git a/ButcherFactory.BO/ButcherFactory.BO.csproj b/ButcherFactory.BO/ButcherFactory.BO.csproj index df4546a..08f0bf8 100644 --- a/ButcherFactory.BO/ButcherFactory.BO.csproj +++ b/ButcherFactory.BO/ButcherFactory.BO.csproj @@ -58,6 +58,7 @@ + diff --git a/ButcherFactory.BO/LocalBL/SegmentProductionBL.cs b/ButcherFactory.BO/LocalBL/SegmentProductionBL.cs index c065bfc..2996528 100644 --- a/ButcherFactory.BO/LocalBL/SegmentProductionBL.cs +++ b/ButcherFactory.BO/LocalBL/SegmentProductionBL.cs @@ -39,7 +39,8 @@ namespace ButcherFactory.BO.LocalBL query.Columns.Add(DQSelectColumn.Field("TotalCode_Code")); query.Columns.Add(DQSelectColumn.Field("CreateTime")); query.Columns.Add(DQSelectColumn.Field("GoodsType")); - query.Columns.Add(DQSelectColumn.Field("NoTotalCode")); + query.Columns.Add(DQSelectColumn.Field("NoTotalCode")); + query.Columns.Add(DQSelectColumn.Field("Identify")); query.Where.Conditions.Add(DQCondition.And(DQCondition.EQ("InStored", false), DQCondition.EQ("Delete", false), DQCondition.EQ("Submited", submited))); query.OrderBy.Expressions.Add(DQOrderByExpression.Create("ID", true)); if (submited) @@ -74,6 +75,7 @@ namespace ButcherFactory.BO.LocalBL entity.CreateTime = (DateTime)reader[15]; entity.GoodsType = (short?)reader[16]; entity.NoTotalCode = (bool)reader[17]; + entity.Identify = (string)reader[18]; list.Add(entity); } } @@ -525,6 +527,8 @@ namespace ButcherFactory.BO.LocalBL query.Columns.Add(DQSelectColumn.Field("StatisticNumber")); query.Columns.Add(DQSelectColumn.Field("TotalCode_Code")); query.Columns.Add(DQSelectColumn.Field("NoTotalCode")); + query.Columns.Add(DQSelectColumn.Field("Identify")); + query.Columns.Add(DQSelectColumn.Field("IdentifyRemark")); query.Where.Conditions.Add(DQCondition.And(DQCondition.EQ("Submited", true), DQCondition.EQ("Sync", false), DQCondition.EQ("Delete", false))); query.Where.Conditions.Add(DQCondition.LessThan("CreateTime", DateTime.Now.AddMinutes(-1))); query.Range = SelectRange.Top(10); @@ -551,6 +555,8 @@ namespace ButcherFactory.BO.LocalBL obj.StatisticNumber = (decimal?)reader[12]; obj.TotalCode_Code = (string)reader[13]; obj.NoTotalCode = (bool)reader[14]; + obj.Identify = (string)reader[15]; + obj.IdentifyRemark = (string)reader[16]; upload.Add(obj); } } @@ -665,6 +671,12 @@ namespace ButcherFactory.BO.LocalBL query.Where.Conditions.Add(DQCondition.EQ("Action", type)); return query.EExecuteList().Cast(); } + + public static List GetGoodsIdentify() + { + var query = new DmoQuery(typeof(GoodsIdentify)); + return query.EExecuteList().Cast().ToList(); + } } class SegmentProductionMin @@ -687,6 +699,8 @@ namespace ButcherFactory.BO.LocalBL public decimal? StatisticNumber { get; set; } public string TotalCode_Code { get; set; } public bool NoTotalCode { get; set; } + public string Identify { get; set; } + public string IdentifyRemark { get; set; } } class TaskTemp diff --git a/ButcherFactory.BO/Rpcs/BaseInfoSyncRpc.cs b/ButcherFactory.BO/Rpcs/BaseInfoSyncRpc.cs index fe54d99..16f8236 100644 --- a/ButcherFactory.BO/Rpcs/BaseInfoSyncRpc.cs +++ b/ButcherFactory.BO/Rpcs/BaseInfoSyncRpc.cs @@ -112,6 +112,24 @@ namespace ButcherFactory.BO.Rpcs return true; } + public static bool SyncGoodsIdentify(out List list) { + using (var session = DmoSession.New()) + { + var json = RpcFacade.Call(baseInfoRpcPath + "SyncGoodsIdentify"); + list = JsonConvert.DeserializeObject>(json); + var sql = "truncate table [Butcher_GoodsIdentify]"; + session.ExecuteSqlNonQuery(sql); + + foreach (var item in list) + { + session.Insert(item); + } + + session.Commit(); + } + return true; + } + static void DeleteClientSet(long id, IDmoSession session) { var detail = new DQDeleteDom(typeof(ClientGoodsSet_Detail)); diff --git a/ButcherFactory.Form/ButcherFactory.Form.csproj b/ButcherFactory.Form/ButcherFactory.Form.csproj index 2297bcd..39559d5 100644 --- a/ButcherFactory.Form/ButcherFactory.Form.csproj +++ b/ButcherFactory.Form/ButcherFactory.Form.csproj @@ -229,6 +229,12 @@ SegmentPickUpForm.cs + + Form + + + IdentifySelectionDialog.cs + Form @@ -418,6 +424,9 @@ SegmentPickUpForm.cs + + IdentifySelectionDialog.cs + LogForm.cs diff --git a/ButcherFactory.Form/Controls/UserControl1.Designer.cs b/ButcherFactory.Form/Controls/UserControl1.Designer.cs index 687618c..fe19961 100644 --- a/ButcherFactory.Form/Controls/UserControl1.Designer.cs +++ b/ButcherFactory.Form/Controls/UserControl1.Designer.cs @@ -28,50 +28,66 @@ /// private void InitializeComponent() { - this.Label = new ButcherFactory.Controls.CircleButton(); - this.Button = new ButcherFactory.Controls.ColorButton(); - this.SuspendLayout(); - // - // Label - // - this.Label.BackColor = System.Drawing.Color.DeepSkyBlue; - this.Label.Font = new System.Drawing.Font("黑体", 14F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.Label.ForeColor = System.Drawing.Color.White; - this.Label.Location = new System.Drawing.Point(111, 0); - this.Label.MaxCount = 1; - this.Label.MinCount = 0; - this.Label.Name = "Label"; - this.Label.Size = new System.Drawing.Size(64, 56); - this.Label.TabIndex = 1; - this.Label.Text = "1-0"; - this.Label.UseVisualStyleBackColor = false; - // - // Button - // - this.Button.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(77)))), ((int)(((byte)(135)))), ((int)(((byte)(245))))); - this.Button.ForeColor = System.Drawing.Color.White; - this.Button.Location = new System.Drawing.Point(0, 0); - this.Button.Name = "Button"; - this.Button.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(15)))), ((int)(((byte)(215)))), ((int)(((byte)(107))))); - this.Button.Size = new System.Drawing.Size(140, 90); - this.Button.TabIndex = 2; - this.Button.UseVisualStyleBackColor = false; - // - // ButtonTag - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.Label); - this.Controls.Add(this.Button); - this.Name = "ButtonTag"; - this.Size = new System.Drawing.Size(178, 90); - this.ResumeLayout(false); - + this.Label = new ButcherFactory.Controls.CircleButton(); + this.Button = new ButcherFactory.Controls.ColorButton(); + this.identityButton = new ButcherFactory.Controls.ColorButton(); + this.SuspendLayout(); + // + // Label + // + this.Label.BackColor = System.Drawing.Color.DeepSkyBlue; + this.Label.Font = new System.Drawing.Font("黑体", 14F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.Label.ForeColor = System.Drawing.Color.White; + this.Label.Location = new System.Drawing.Point(111, 0); + this.Label.MaxCount = 1; + this.Label.MinCount = 0; + this.Label.Name = "Label"; + this.Label.Size = new System.Drawing.Size(64, 56); + this.Label.TabIndex = 1; + this.Label.Text = "1-0"; + this.Label.UseVisualStyleBackColor = false; + // + // Button + // + this.Button.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(77)))), ((int)(((byte)(135)))), ((int)(((byte)(245))))); + this.Button.ForeColor = System.Drawing.Color.White; + this.Button.Location = new System.Drawing.Point(0, 0); + this.Button.Name = "Button"; + this.Button.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(15)))), ((int)(((byte)(215)))), ((int)(((byte)(107))))); + this.Button.Size = new System.Drawing.Size(140, 90); + this.Button.TabIndex = 2; + this.Button.UseVisualStyleBackColor = false; + // + // identityButton + // + this.identityButton.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255))))); + this.identityButton.Font = new System.Drawing.Font("宋体", 12F); + this.identityButton.ForeColor = System.Drawing.Color.DimGray; + this.identityButton.Location = new System.Drawing.Point(0, 87); + this.identityButton.Name = "identityButton"; + this.identityButton.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(15)))), ((int)(((byte)(215)))), ((int)(((byte)(107))))); + this.identityButton.Size = new System.Drawing.Size(140, 55); + this.identityButton.TabIndex = 3; + this.identityButton.Text = "选择标识"; + this.identityButton.UseVisualStyleBackColor = false; + // + // ButtonTag + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.identityButton); + this.Controls.Add(this.Label); + this.Controls.Add(this.Button); + this.Name = "ButtonTag"; + this.Size = new System.Drawing.Size(178, 145); + this.ResumeLayout(false); + } #endregion public ColorButton Button; - public CircleButton Label; - } + public CircleButton Label; + public ColorButton identityButton; + } } diff --git a/ButcherFactory.Form/Controls/UserControl1.resx b/ButcherFactory.Form/Controls/UserControl1.resx index 1af7de1..29dcb1b 100644 --- a/ButcherFactory.Form/Controls/UserControl1.resx +++ b/ButcherFactory.Form/Controls/UserControl1.resx @@ -1,120 +1,120 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + \ No newline at end of file diff --git a/ButcherFactory.Form/SegmentProductionAuto_/IdentifySelectionDialog.Designer.cs b/ButcherFactory.Form/SegmentProductionAuto_/IdentifySelectionDialog.Designer.cs new file mode 100644 index 0000000..286d00b --- /dev/null +++ b/ButcherFactory.Form/SegmentProductionAuto_/IdentifySelectionDialog.Designer.cs @@ -0,0 +1,123 @@ + +namespace ButcherFactory.SegmentProductionAuto_ +{ + partial class IdentifySelectionDialog + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.okBtn = new ButcherFactory.Controls.ColorButton(); + this.clearBtn = new ButcherFactory.Controls.ColorButton(); + this.identityRemark = new System.Windows.Forms.Label(); + this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); + this.goodsNameLbl = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // okBtn + // + this.okBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(77)))), ((int)(((byte)(135)))), ((int)(((byte)(245))))); + this.okBtn.Font = new System.Drawing.Font("微软雅黑", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.okBtn.ForeColor = System.Drawing.Color.White; + this.okBtn.Location = new System.Drawing.Point(110, 374); + this.okBtn.Name = "okBtn"; + this.okBtn.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(15)))), ((int)(((byte)(215)))), ((int)(((byte)(107))))); + this.okBtn.Size = new System.Drawing.Size(140, 56); + this.okBtn.TabIndex = 0; + this.okBtn.Text = "确定"; + this.okBtn.UseVisualStyleBackColor = false; + this.okBtn.Click += new System.EventHandler(this.okBtn_Click); + // + // clearBtn + // + this.clearBtn.BackColor = System.Drawing.Color.Red; + this.clearBtn.Font = new System.Drawing.Font("微软雅黑", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.clearBtn.ForeColor = System.Drawing.Color.White; + this.clearBtn.Location = new System.Drawing.Point(321, 374); + this.clearBtn.Name = "clearBtn"; + this.clearBtn.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(15)))), ((int)(((byte)(215)))), ((int)(((byte)(107))))); + this.clearBtn.Size = new System.Drawing.Size(137, 56); + this.clearBtn.TabIndex = 1; + this.clearBtn.Text = "清除标识"; + this.clearBtn.UseVisualStyleBackColor = false; + this.clearBtn.Click += new System.EventHandler(this.clearBtn_Click); + // + // identityRemark + // + this.identityRemark.AutoSize = true; + this.identityRemark.Font = new System.Drawing.Font("微软雅黑", 14F); + this.identityRemark.ForeColor = System.Drawing.Color.Red; + this.identityRemark.Location = new System.Drawing.Point(36, 314); + this.identityRemark.Name = "identityRemark"; + this.identityRemark.Size = new System.Drawing.Size(88, 25); + this.identityRemark.TabIndex = 2; + this.identityRemark.Text = "标识注释"; + // + // flowLayoutPanel1 + // + this.flowLayoutPanel1.Location = new System.Drawing.Point(17, 90); + this.flowLayoutPanel1.Name = "flowLayoutPanel1"; + this.flowLayoutPanel1.Size = new System.Drawing.Size(529, 184); + this.flowLayoutPanel1.TabIndex = 3; + // + // goodsNameLbl + // + this.goodsNameLbl.AutoSize = true; + this.goodsNameLbl.Font = new System.Drawing.Font("微软雅黑", 17F, System.Drawing.FontStyle.Bold); + this.goodsNameLbl.ForeColor = System.Drawing.Color.DeepSkyBlue; + this.goodsNameLbl.Location = new System.Drawing.Point(24, 31); + this.goodsNameLbl.Name = "goodsNameLbl"; + this.goodsNameLbl.Size = new System.Drawing.Size(83, 31); + this.goodsNameLbl.TabIndex = 4; + this.goodsNameLbl.Text = "冻带皮"; + // + // IdentifySelectionDialog + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(566, 468); + this.Controls.Add(this.goodsNameLbl); + this.Controls.Add(this.flowLayoutPanel1); + this.Controls.Add(this.identityRemark); + this.Controls.Add(this.clearBtn); + this.Controls.Add(this.okBtn); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; + this.Name = "IdentifySelectionDialog"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "标识选择"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private Controls.ColorButton okBtn; + private Controls.ColorButton clearBtn; + private System.Windows.Forms.Label identityRemark; + private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1; + private System.Windows.Forms.Label goodsNameLbl; + } +} \ No newline at end of file diff --git a/ButcherFactory.Form/SegmentProductionAuto_/IdentifySelectionDialog.cs b/ButcherFactory.Form/SegmentProductionAuto_/IdentifySelectionDialog.cs new file mode 100644 index 0000000..ced0de4 --- /dev/null +++ b/ButcherFactory.Form/SegmentProductionAuto_/IdentifySelectionDialog.cs @@ -0,0 +1,51 @@ +using ButcherFactory.BO; +using ButcherFactory.Controls; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace ButcherFactory.SegmentProductionAuto_ +{ + public partial class IdentifySelectionDialog : Form + { + ClientGoodsSet_Detail set; + public IdentifySelectionDialog(ClientGoodsSet_Detail clientGoodsSet) + { + this.set = clientGoodsSet; + InitializeComponent(); + goodsNameLbl.Text = set.Goods_Name; + identityRemark.Text = set.SelectedIdentify == null ? "" : set.SelectedIdentify.Remark; + foreach (var item in set.Identify) + { + var btn = new ColorButton() { Width = 100, Height = 62, Text = item.Identify, Font = new Font("宋体", 15), Margin = new Padding(15, 3, 15, 0), EnableGroup = true }; + btn.Tag = item; + if (set.SelectedIdentify != null && set.SelectedIdentify.Identify == item.Identify) + btn.Selected = true; + btn.Click += delegate + { + var obj = btn.Tag as GoodsIdentify; + identityRemark.Text = obj.Remark; + set.SelectedIdentify = obj; + }; + flowLayoutPanel1.Controls.Add(btn); + } + } + + private void okBtn_Click(object sender, EventArgs e) + { + this.Close(); + } + + private void clearBtn_Click(object sender, EventArgs e) + { + set.SelectedIdentify = null; + this.Close(); + } + } +} diff --git a/ButcherFactory.Form/SegmentProductionAuto_/IdentifySelectionDialog.resx b/ButcherFactory.Form/SegmentProductionAuto_/IdentifySelectionDialog.resx new file mode 100644 index 0000000..29dcb1b --- /dev/null +++ b/ButcherFactory.Form/SegmentProductionAuto_/IdentifySelectionDialog.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.cs b/ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.cs index ea30f6a..f6c4fb0 100644 --- a/ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.cs +++ b/ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.cs @@ -43,6 +43,7 @@ namespace ButcherFactory.SegmentProductionAuto_ long? batchID; DateTime? batchDate; NotAuto.SegmentProductionFormConfig config; + List identityList; public SegmentProductionAutoForm() { InitializeComponent(); @@ -115,6 +116,7 @@ namespace ButcherFactory.SegmentProductionAuto_ wDic = mCache.Cache; _freshTotalCode = SegmentProductionBL.InitFreshTotalCode(); _stayTotalCode = SegmentProductionBL.InitStayTotalCode(); + identityList = SegmentProductionBL.GetGoodsIdentify(); } void LoadBind() @@ -135,6 +137,7 @@ namespace ButcherFactory.SegmentProductionAuto_ var changed = BaseInfoSyncRpc.SyncGoodsByTag(ApplyClient.分割品); changed = BaseInfoSyncRpc.SyncBaseInfo() || changed; changed = BaseInfoSyncRpc.SyncProductBatch(1) || changed; + changed = BaseInfoSyncRpc.SyncGoodsIdentify(out identityList) || changed; ok = true; if (changed || !bind) BindBasicInfo(); @@ -143,8 +146,9 @@ namespace ButcherFactory.SegmentProductionAuto_ msglbl.Text = string.Empty; })); } - catch + catch(Exception ex) { + if (!bind) { BindBasicInfo(); @@ -191,7 +195,6 @@ namespace ButcherFactory.SegmentProductionAuto_ var groupBtn = sender as ColorButton; groupKey = groupBtn.Text; var arr = goodsSetDic[groupKey]; - int i = 0; foreach (var item in arr) { var bTag = new ButtonTag(); @@ -283,6 +286,27 @@ namespace ButcherFactory.SegmentProductionAuto_ } bTag.Button.Tag = item; + if (item.SelectedIdentify != null) { + bTag.identityButton.Text = item.SelectedIdentify.Identify; + } + item.Identify = identityList.Where(x => x.Goods_ID == item.Goods_ID); + if (item.Identify.Any()) + { + bTag.identityButton.Click += delegate + { + new IdentifySelectionDialog(item).ShowDialog(); + if (item.SelectedIdentify != null) + { + bTag.identityButton.Text = item.SelectedIdentify.Identify; + } + else { + bTag.identityButton.Text = "选择标识"; + } + }; + } + else { + bTag.identityButton.Enabled = false; + } bTag.Button.Text = item.Goods_Name; bTag.Button.Font = new Font("黑体", 15, FontStyle.Bold); bTag.Button.BackColor = Color.Black; @@ -292,7 +316,6 @@ namespace ButcherFactory.SegmentProductionAuto_ bTag.Button.Width = 140; bTag.Button.Height = 90; flowLayoutPanel2.Controls.Add(bTag); - i++; } } @@ -337,7 +360,11 @@ namespace ButcherFactory.SegmentProductionAuto_ entity.StandardPic = detail.StandardPic; entity.GoodsType = detail.GoodsType; entity.NoTotalCode = detail.NoTotalCode; - + if (detail.SelectedIdentify != null) + { + entity.Identify = detail.SelectedIdentify.Identify; + entity.IdentifyRemark = detail.SelectedIdentify.Remark; + } if (!string.IsNullOrEmpty(statisticNumberBox.Text)) entity.StatisticNumber = decimal.Parse(statisticNumberBox.Text); diff --git a/ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint.cs b/ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint.cs index 44cc6f3..eab197e 100644 --- a/ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint.cs +++ b/ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint.cs @@ -40,6 +40,7 @@ namespace ButcherFactory.SegmentProduction_ var url = string.Format(AppContext.ConnectInfo.TraceBackUrl + "?code={0}", entity.BarCode); BwpClientPrint.BwpClientWebPrint.Create2DPic(url, imgUrl, 120); dic.Add("$ImageUrl", imgUrl); + dic.Add("$Identity", entity.Identify); var barImgUrl = string.Format(IMGFILE, id + "_bar"); try diff --git a/ButcherFactory.Form/SegmentProduction_/SegmentSumCodePrint.cs b/ButcherFactory.Form/SegmentProduction_/SegmentSumCodePrint.cs index 72db704..82f37fe 100644 --- a/ButcherFactory.Form/SegmentProduction_/SegmentSumCodePrint.cs +++ b/ButcherFactory.Form/SegmentProduction_/SegmentSumCodePrint.cs @@ -23,13 +23,13 @@ namespace ButcherFactory.SegmentProduction_ var dic = new Dictionary(); var entity = entitys.FirstOrDefault(); - var groupByGoods = entitys.GroupBy(x => x.Goods_ID); + var groupByGoods = entitys.GroupBy(x =>new { x.Goods_ID, x.Identify }); var info = string.Empty; foreach (var item in groupByGoods) { var f = item.FirstOrDefault(); - info += string.Format("

{0}

", f.Goods_Name); - info += string.Format("

件数:{0}

", item.Count()); + info += string.Format("

{0}

", f.Goods_Name); + info += string.Format("

件数:{0}    {1}

", item.Count(), f.Identify); }