From d50510a36fd789e891bb7424b2ef4093582844eb Mon Sep 17 00:00:00 2001 From: yibo <361071264@qq.com> Date: Thu, 26 Apr 2018 17:41:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E5=89=B2=E5=93=81=E7=A7=B0=E9=87=8D?= =?UTF-8?q?=E8=AE=A1=E6=95=B0=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.BO/Bill/SegmentProduction.cs | 6 +- ButcherFactory.BO/LocalBL/CarcassTakeOutBL.cs | 3 + .../LocalBL/SegmentProductionBL.cs | 22 +- .../CarcassTakeOutForm.Designer.cs | 174 +++++------ .../SegmentProductionForm.Designer.cs | 285 +++++++++--------- .../SegmentProductionForm.cs | 37 ++- .../SegmentProductionForm.resx | 6 +- .../TrunOutDialog.Designer.cs | 11 + .../SegmentProduction_/TrunOutDialog.cs | 6 +- .../SegmentProduction_/TrunOutDialog.resx | 3 + 10 files changed, 292 insertions(+), 261 deletions(-) diff --git a/ButcherFactory.BO/Bill/SegmentProduction.cs b/ButcherFactory.BO/Bill/SegmentProduction.cs index c2a6060..33d5b96 100644 --- a/ButcherFactory.BO/Bill/SegmentProduction.cs +++ b/ButcherFactory.BO/Bill/SegmentProduction.cs @@ -31,7 +31,9 @@ namespace ButcherFactory.BO public bool Submited { get; set; } - //挂起状态 - public bool TrunOut { get; set; } + ////挂起状态 + //public bool TrunOut { get; set; } + + public long? TrunOutID { get; set; } } } diff --git a/ButcherFactory.BO/LocalBL/CarcassTakeOutBL.cs b/ButcherFactory.BO/LocalBL/CarcassTakeOutBL.cs index 0cea67a..2966de0 100644 --- a/ButcherFactory.BO/LocalBL/CarcassTakeOutBL.cs +++ b/ButcherFactory.BO/LocalBL/CarcassTakeOutBL.cs @@ -235,6 +235,7 @@ namespace ButcherFactory.BO.LocalBL query.Columns.Add(DQSelectColumn.Field("Goods_ID")); query.Columns.Add(DQSelectColumn.Field("Weight")); query.Columns.Add(DQSelectColumn.Field("CreateTime")); + query.Columns.Add(DQSelectColumn.Field("GroupID")); query.Where.Conditions.Add(DQCondition.And(DQCondition.EQ("Submited", true), DQCondition.EQ("Sync", false))); query.Range = SelectRange.Top(10); query.OrderBy.Expressions.Add(DQOrderByExpression.Create("ID")); @@ -257,6 +258,7 @@ namespace ButcherFactory.BO.LocalBL } obj.Weight = (decimal)reader[7]; obj.Time = (DateTime)reader[8]; + obj.GroupID = (long?)reader[9]; upload.Add(obj); } } @@ -283,5 +285,6 @@ namespace ButcherFactory.BO.LocalBL public long? Goods_ID { get; set; } public decimal? Weight { get; set; } public DateTime? Time { get; set; } + public long? GroupID { get; set; } } } diff --git a/ButcherFactory.BO/LocalBL/SegmentProductionBL.cs b/ButcherFactory.BO/LocalBL/SegmentProductionBL.cs index adc36b9..defeec4 100644 --- a/ButcherFactory.BO/LocalBL/SegmentProductionBL.cs +++ b/ButcherFactory.BO/LocalBL/SegmentProductionBL.cs @@ -24,7 +24,7 @@ namespace ButcherFactory.BO.LocalBL query.Columns.Add(DQSelectColumn.Field("Weight")); query.Columns.Add(DQSelectColumn.Field("Goods_Name")); query.Columns.Add(DQSelectColumn.Field("GroupID")); - query.Columns.Add(DQSelectColumn.Field("TrunOut")); + query.Columns.Add(DQSelectColumn.Field("TrunOutID")); query.Where.Conditions.Add(DQCondition.And(DQCondition.EQ("Delete", false), DQCondition.EQ("Submited", submited))); query.OrderBy.Expressions.Add(DQOrderByExpression.Create("ID", true)); if (submited) @@ -43,7 +43,7 @@ namespace ButcherFactory.BO.LocalBL entity.Weight = (decimal)reader[3]; entity.Goods_Name = (string)reader[4]; entity.GroupID = (long?)reader[5]; - entity.TrunOut = (bool)reader[6]; + entity.TrunOutID = (long?)reader[6]; entity.Submited = submited; list.Add(entity); } @@ -83,20 +83,13 @@ namespace ButcherFactory.BO.LocalBL { using (var session = DmoSession.New()) { - var groupID = GenerateGroupID(session); + var groupID = ids.Max(); BatchUpdate(ids, session, new Tuple("GroupID", groupID)); session.Commit(); return groupID; } } - static long GenerateGroupID(IDmoSession session) - { - var query = new DQueryDom(new JoinAlias("_main", typeof(SegmentProduction))); - query.Columns.Add(DQSelectColumn.Max("GroupID")); - return (query.EExecuteScalar(session) ?? 0) + 1; - } - static void BatchUpdate(IEnumerable ids, IDmoSession session, params Tuple[] keyValues) { var update = new DQUpdateDom(typeof(SegmentProduction)); @@ -116,5 +109,14 @@ namespace ButcherFactory.BO.LocalBL session.Commit(); } } + + public static void TrunBack(IEnumerable ids) + { + using (var session = DmoSession.New()) + { + BatchUpdate(ids, session, new Tuple("TrunOutID", null)); + session.Commit(); + } + } } } diff --git a/ButcherFactory.Form/CarcassTakeOut_/CarcassTakeOutForm.Designer.cs b/ButcherFactory.Form/CarcassTakeOut_/CarcassTakeOutForm.Designer.cs index a8467a1..b3510a1 100644 --- a/ButcherFactory.Form/CarcassTakeOut_/CarcassTakeOutForm.Designer.cs +++ b/ButcherFactory.Form/CarcassTakeOut_/CarcassTakeOutForm.Designer.cs @@ -43,6 +43,8 @@ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle(); this.workUnitSelect = new System.Windows.Forms.ComboBox(); this.splitContainer1 = new System.Windows.Forms.SplitContainer(); + this.productBatchSelect = new System.Windows.Forms.ComboBox(); + this.uLabel2 = new WinFormControl.ULabel(); this.noBarCode = new WinFormControl.UButton(); this.closeBtn = new WinFormControl.UButton(); this.uTimerLabel1 = new WinFormControl.UTimerLabel(); @@ -50,6 +52,7 @@ this.netStateWatch1 = new WinFormControl.NetStateWatch(); this.uWeightControl1 = new WinFormControl.UWeightControl(); this.uLabel1 = new WinFormControl.ULabel(); + this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); this.groupBox2 = new System.Windows.Forms.GroupBox(); this.historyDataGrid = new WinFormControl.UDataGridView(); this.H_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); @@ -65,18 +68,15 @@ this.W_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.W_Weight = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.needSubmitGrid = new WinFormControl.UDataGridView(); - this.readBtn = new WinFormControl.UButton(); - this.submitBtn = new WinFormControl.UButton(); - this.uLabel3 = new WinFormControl.ULabel(); - this.productBatchSelect = new System.Windows.Forms.ComboBox(); - this.uLabel2 = new WinFormControl.ULabel(); this.U_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.U_RowIndex = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.U_BarCode = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.U_Goods_Name = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.U_BeforeWeight = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.U_Weight = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); + this.readBtn = new WinFormControl.UButton(); + this.submitBtn = new WinFormControl.UButton(); + this.uLabel3 = new WinFormControl.ULabel(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); @@ -136,6 +136,28 @@ this.splitContainer1.SplitterDistance = 86; this.splitContainer1.TabIndex = 1; // + // productBatchSelect + // + this.productBatchSelect.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.productBatchSelect.Font = new System.Drawing.Font("宋体", 15F); + this.productBatchSelect.FormattingEnabled = true; + this.productBatchSelect.Location = new System.Drawing.Point(984, 50); + this.productBatchSelect.Name = "productBatchSelect"; + this.productBatchSelect.Size = new System.Drawing.Size(170, 28); + this.productBatchSelect.TabIndex = 15; + // + // uLabel2 + // + this.uLabel2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.uLabel2.AutoSize = true; + this.uLabel2.BackColor = System.Drawing.Color.Transparent; + this.uLabel2.Font = new System.Drawing.Font("宋体", 15F); + this.uLabel2.Location = new System.Drawing.Point(883, 53); + this.uLabel2.Name = "uLabel2"; + this.uLabel2.Size = new System.Drawing.Size(109, 20); + this.uLabel2.TabIndex = 16; + this.uLabel2.Text = "生产批次:"; + // // noBarCode // this.noBarCode.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); @@ -156,7 +178,7 @@ this.noBarCode.TabIndex = 14; this.noBarCode.Text = "无 码"; this.noBarCode.UseVisualStyleBackColor = true; - this.noBarCode.WithStataHode = false; + this.noBarCode.WithStataHode = true; this.noBarCode.Click += new System.EventHandler(this.noBarCode_Click); // // closeBtn @@ -233,6 +255,17 @@ this.uLabel1.TabIndex = 5; this.uLabel1.Text = "工作单元:"; // + // flowLayoutPanel1 + // + this.flowLayoutPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Right))); + this.flowLayoutPanel1.AutoScroll = true; + this.flowLayoutPanel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.flowLayoutPanel1.Location = new System.Drawing.Point(793, -1); + this.flowLayoutPanel1.Name = "flowLayoutPanel1"; + this.flowLayoutPanel1.Size = new System.Drawing.Size(514, 521); + this.flowLayoutPanel1.TabIndex = 4; + // // groupBox2 // this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) @@ -465,6 +498,53 @@ this.needSubmitGrid.Size = new System.Drawing.Size(508, 200); this.needSubmitGrid.TabIndex = 1; // + // U_ID + // + this.U_ID.DataPropertyName = "ID"; + this.U_ID.HeaderText = "ID"; + this.U_ID.Name = "U_ID"; + this.U_ID.ReadOnly = true; + this.U_ID.Visible = false; + // + // U_RowIndex + // + this.U_RowIndex.DataPropertyName = "RowIndex"; + this.U_RowIndex.HeaderText = "序号"; + this.U_RowIndex.Name = "U_RowIndex"; + this.U_RowIndex.ReadOnly = true; + // + // U_BarCode + // + this.U_BarCode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.U_BarCode.DataPropertyName = "BarCode"; + this.U_BarCode.HeaderText = "条码"; + this.U_BarCode.Name = "U_BarCode"; + this.U_BarCode.ReadOnly = true; + // + // U_Goods_Name + // + this.U_Goods_Name.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.U_Goods_Name.DataPropertyName = "Goods_Name"; + this.U_Goods_Name.HeaderText = "产品名称"; + this.U_Goods_Name.Name = "U_Goods_Name"; + this.U_Goods_Name.ReadOnly = true; + // + // U_BeforeWeight + // + this.U_BeforeWeight.DataPropertyName = "BeforeWeight"; + dataGridViewCellStyle11.Format = "#0.######"; + this.U_BeforeWeight.DefaultCellStyle = dataGridViewCellStyle11; + this.U_BeforeWeight.HeaderText = "入库重量"; + this.U_BeforeWeight.Name = "U_BeforeWeight"; + this.U_BeforeWeight.ReadOnly = true; + // + // U_Weight + // + this.U_Weight.DataPropertyName = "Weight"; + this.U_Weight.HeaderText = "重量"; + this.U_Weight.Name = "U_Weight"; + this.U_Weight.ReadOnly = true; + // // readBtn // this.readBtn.AsClicked = false; @@ -520,86 +600,6 @@ this.uLabel3.TabIndex = 0; this.uLabel3.Text = "领料明细"; // - // productBatchSelect - // - this.productBatchSelect.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.productBatchSelect.Font = new System.Drawing.Font("宋体", 15F); - this.productBatchSelect.FormattingEnabled = true; - this.productBatchSelect.Location = new System.Drawing.Point(984, 50); - this.productBatchSelect.Name = "productBatchSelect"; - this.productBatchSelect.Size = new System.Drawing.Size(170, 28); - this.productBatchSelect.TabIndex = 15; - // - // uLabel2 - // - this.uLabel2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.uLabel2.AutoSize = true; - this.uLabel2.BackColor = System.Drawing.Color.Transparent; - this.uLabel2.Font = new System.Drawing.Font("宋体", 15F); - this.uLabel2.Location = new System.Drawing.Point(883, 53); - this.uLabel2.Name = "uLabel2"; - this.uLabel2.Size = new System.Drawing.Size(109, 20); - this.uLabel2.TabIndex = 16; - this.uLabel2.Text = "生产批次:"; - // - // U_ID - // - this.U_ID.DataPropertyName = "ID"; - this.U_ID.HeaderText = "ID"; - this.U_ID.Name = "U_ID"; - this.U_ID.ReadOnly = true; - this.U_ID.Visible = false; - // - // U_RowIndex - // - this.U_RowIndex.DataPropertyName = "RowIndex"; - this.U_RowIndex.HeaderText = "序号"; - this.U_RowIndex.Name = "U_RowIndex"; - this.U_RowIndex.ReadOnly = true; - // - // U_BarCode - // - this.U_BarCode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.U_BarCode.DataPropertyName = "BarCode"; - this.U_BarCode.HeaderText = "条码"; - this.U_BarCode.Name = "U_BarCode"; - this.U_BarCode.ReadOnly = true; - // - // U_Goods_Name - // - this.U_Goods_Name.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.U_Goods_Name.DataPropertyName = "Goods_Name"; - this.U_Goods_Name.HeaderText = "产品名称"; - this.U_Goods_Name.Name = "U_Goods_Name"; - this.U_Goods_Name.ReadOnly = true; - // - // U_BeforeWeight - // - this.U_BeforeWeight.DataPropertyName = "BeforeWeight"; - dataGridViewCellStyle11.Format = "#0.######"; - this.U_BeforeWeight.DefaultCellStyle = dataGridViewCellStyle11; - this.U_BeforeWeight.HeaderText = "入库重量"; - this.U_BeforeWeight.Name = "U_BeforeWeight"; - this.U_BeforeWeight.ReadOnly = true; - // - // U_Weight - // - this.U_Weight.DataPropertyName = "Weight"; - this.U_Weight.HeaderText = "重量"; - this.U_Weight.Name = "U_Weight"; - this.U_Weight.ReadOnly = true; - // - // flowLayoutPanel1 - // - this.flowLayoutPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Right))); - this.flowLayoutPanel1.AutoScroll = true; - this.flowLayoutPanel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.flowLayoutPanel1.Location = new System.Drawing.Point(793, -1); - this.flowLayoutPanel1.Name = "flowLayoutPanel1"; - this.flowLayoutPanel1.Size = new System.Drawing.Size(514, 521); - this.flowLayoutPanel1.TabIndex = 4; - // // CarcassTakeOutForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); diff --git a/ButcherFactory.Form/SegmentProduction_/SegmentProductionForm.Designer.cs b/ButcherFactory.Form/SegmentProduction_/SegmentProductionForm.Designer.cs index e2debd1..79d71c1 100644 --- a/ButcherFactory.Form/SegmentProduction_/SegmentProductionForm.Designer.cs +++ b/ButcherFactory.Form/SegmentProduction_/SegmentProductionForm.Designer.cs @@ -29,40 +29,38 @@ private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SegmentProductionForm)); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle67 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle68 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle70 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle69 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle61 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle62 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle66 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle63 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle64 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle65 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle(); this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.barPrintCheck = new System.Windows.Forms.CheckBox(); - this.productBatchSelect = new System.Windows.Forms.ComboBox(); - this.workUnitSelect = new System.Windows.Forms.ComboBox(); - this.splitContainer2 = new System.Windows.Forms.SplitContainer(); - this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.flowLayoutPanel2 = new System.Windows.Forms.FlowLayoutPanel(); - this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); this.closeBtn = new WinFormControl.UButton(); this.uTimerLabel1 = new WinFormControl.UTimerLabel(); + this.productBatchSelect = new System.Windows.Forms.ComboBox(); + this.workUnitSelect = new System.Windows.Forms.ComboBox(); this.uLabel1 = new WinFormControl.ULabel(); this.uLabel2 = new WinFormControl.ULabel(); this.netStateWatch1 = new WinFormControl.NetStateWatch(); this.uWeightControl1 = new WinFormControl.UWeightControl(); + this.splitContainer2 = new System.Windows.Forms.SplitContainer(); this.submitBtn = new WinFormControl.UButton(); this.deleteBtn = new WinFormControl.UButton(); this.rePrintBtn = new WinFormControl.UButton(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); this.historyDataGrid = new WinFormControl.UDataGridView(); this.H_RowIndex = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.H_BarCode = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.H_Goods_Name = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.H_Weight = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.uLabel3 = new WinFormControl.ULabel(); + this.groupBox2 = new System.Windows.Forms.GroupBox(); this.taskDataGrid = new WinFormControl.UDataGridView(); this.T_Item = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.T_Need = new System.Windows.Forms.DataGridViewTextBoxColumn(); @@ -70,9 +68,11 @@ this.T_Last = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.GoodsLabel = new WinFormControl.ULabel(); this.trunOutBtn = new WinFormControl.UButton(); + this.flowLayoutPanel2 = new System.Windows.Forms.FlowLayoutPanel(); this.switchBtn = new WinFormControl.UButton(); this.goodsSetBtn = new WinFormControl.UButton(); this.endBtn = new WinFormControl.UButton(); + this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); this.startBtn = new WinFormControl.UButton(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); this.splitContainer1.Panel1.SuspendLayout(); @@ -83,8 +83,8 @@ this.splitContainer2.Panel2.SuspendLayout(); this.splitContainer2.SuspendLayout(); this.groupBox1.SuspendLayout(); - this.groupBox2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.historyDataGrid)).BeginInit(); + this.groupBox2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.taskDataGrid)).BeginInit(); this.SuspendLayout(); // @@ -128,101 +128,6 @@ this.barPrintCheck.Text = "启用打码"; this.barPrintCheck.UseVisualStyleBackColor = true; // - // productBatchSelect - // - this.productBatchSelect.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.productBatchSelect.Font = new System.Drawing.Font("宋体", 15F); - this.productBatchSelect.FormattingEnabled = true; - this.productBatchSelect.Location = new System.Drawing.Point(903, 47); - this.productBatchSelect.Name = "productBatchSelect"; - this.productBatchSelect.Size = new System.Drawing.Size(170, 28); - this.productBatchSelect.TabIndex = 11; - // - // workUnitSelect - // - this.workUnitSelect.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.workUnitSelect.Font = new System.Drawing.Font("宋体", 15F); - this.workUnitSelect.FormattingEnabled = true; - this.workUnitSelect.Location = new System.Drawing.Point(903, 11); - this.workUnitSelect.Name = "workUnitSelect"; - this.workUnitSelect.Size = new System.Drawing.Size(170, 28); - this.workUnitSelect.TabIndex = 10; - // - // splitContainer2 - // - this.splitContainer2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill; - this.splitContainer2.FixedPanel = System.Windows.Forms.FixedPanel.Panel2; - this.splitContainer2.Location = new System.Drawing.Point(0, 0); - this.splitContainer2.Name = "splitContainer2"; - // - // splitContainer2.Panel1 - // - this.splitContainer2.Panel1.Controls.Add(this.submitBtn); - this.splitContainer2.Panel1.Controls.Add(this.deleteBtn); - this.splitContainer2.Panel1.Controls.Add(this.rePrintBtn); - this.splitContainer2.Panel1.Controls.Add(this.groupBox1); - this.splitContainer2.Panel1.Controls.Add(this.groupBox2); - // - // splitContainer2.Panel2 - // - this.splitContainer2.Panel2.Controls.Add(this.trunOutBtn); - this.splitContainer2.Panel2.Controls.Add(this.flowLayoutPanel2); - this.splitContainer2.Panel2.Controls.Add(this.switchBtn); - this.splitContainer2.Panel2.Controls.Add(this.goodsSetBtn); - this.splitContainer2.Panel2.Controls.Add(this.endBtn); - this.splitContainer2.Panel2.Controls.Add(this.flowLayoutPanel1); - this.splitContainer2.Panel2.Controls.Add(this.startBtn); - this.splitContainer2.Size = new System.Drawing.Size(1226, 511); - this.splitContainer2.SplitterDistance = 554; - this.splitContainer2.TabIndex = 0; - // - // groupBox1 - // - this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.groupBox1.Controls.Add(this.historyDataGrid); - this.groupBox1.Controls.Add(this.uLabel3); - this.groupBox1.Location = new System.Drawing.Point(10, 174); - this.groupBox1.Name = "groupBox1"; - this.groupBox1.Padding = new System.Windows.Forms.Padding(5); - this.groupBox1.Size = new System.Drawing.Size(533, 332); - this.groupBox1.TabIndex = 5; - this.groupBox1.TabStop = false; - // - // groupBox2 - // - this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.groupBox2.Controls.Add(this.taskDataGrid); - this.groupBox2.Controls.Add(this.GoodsLabel); - this.groupBox2.Location = new System.Drawing.Point(9, 8); - this.groupBox2.Name = "groupBox2"; - this.groupBox2.Padding = new System.Windows.Forms.Padding(5); - this.groupBox2.Size = new System.Drawing.Size(533, 120); - this.groupBox2.TabIndex = 4; - this.groupBox2.TabStop = false; - // - // flowLayoutPanel2 - // - this.flowLayoutPanel2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.flowLayoutPanel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.flowLayoutPanel2.Location = new System.Drawing.Point(-3, 125); - this.flowLayoutPanel2.Name = "flowLayoutPanel2"; - this.flowLayoutPanel2.Size = new System.Drawing.Size(670, 384); - this.flowLayoutPanel2.TabIndex = 21; - // - // flowLayoutPanel1 - // - this.flowLayoutPanel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.flowLayoutPanel1.Location = new System.Drawing.Point(-3, 49); - this.flowLayoutPanel1.Name = "flowLayoutPanel1"; - this.flowLayoutPanel1.Size = new System.Drawing.Size(547, 70); - this.flowLayoutPanel1.TabIndex = 0; - // // closeBtn // this.closeBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); @@ -259,6 +164,26 @@ this.uTimerLabel1.TabIndex = 14; this.uTimerLabel1.Text = "4月21日 16:32:19"; // + // productBatchSelect + // + this.productBatchSelect.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.productBatchSelect.Font = new System.Drawing.Font("宋体", 15F); + this.productBatchSelect.FormattingEnabled = true; + this.productBatchSelect.Location = new System.Drawing.Point(903, 47); + this.productBatchSelect.Name = "productBatchSelect"; + this.productBatchSelect.Size = new System.Drawing.Size(170, 28); + this.productBatchSelect.TabIndex = 11; + // + // workUnitSelect + // + this.workUnitSelect.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.workUnitSelect.Font = new System.Drawing.Font("宋体", 15F); + this.workUnitSelect.FormattingEnabled = true; + this.workUnitSelect.Location = new System.Drawing.Point(903, 11); + this.workUnitSelect.Name = "workUnitSelect"; + this.workUnitSelect.Size = new System.Drawing.Size(170, 28); + this.workUnitSelect.TabIndex = 10; + // // uLabel1 // this.uLabel1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); @@ -300,6 +225,35 @@ this.uWeightControl1.TabIndex = 0; this.uWeightControl1.WeightFalg = null; // + // splitContainer2 + // + this.splitContainer2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer2.FixedPanel = System.Windows.Forms.FixedPanel.Panel2; + this.splitContainer2.Location = new System.Drawing.Point(0, 0); + this.splitContainer2.Name = "splitContainer2"; + // + // splitContainer2.Panel1 + // + this.splitContainer2.Panel1.Controls.Add(this.submitBtn); + this.splitContainer2.Panel1.Controls.Add(this.deleteBtn); + this.splitContainer2.Panel1.Controls.Add(this.rePrintBtn); + this.splitContainer2.Panel1.Controls.Add(this.groupBox1); + this.splitContainer2.Panel1.Controls.Add(this.groupBox2); + // + // splitContainer2.Panel2 + // + this.splitContainer2.Panel2.Controls.Add(this.trunOutBtn); + this.splitContainer2.Panel2.Controls.Add(this.flowLayoutPanel2); + this.splitContainer2.Panel2.Controls.Add(this.switchBtn); + this.splitContainer2.Panel2.Controls.Add(this.goodsSetBtn); + this.splitContainer2.Panel2.Controls.Add(this.endBtn); + this.splitContainer2.Panel2.Controls.Add(this.flowLayoutPanel1); + this.splitContainer2.Panel2.Controls.Add(this.startBtn); + this.splitContainer2.Size = new System.Drawing.Size(1226, 511); + this.splitContainer2.SplitterDistance = 554; + this.splitContainer2.TabIndex = 0; + // // submitBtn // this.submitBtn.AsClicked = false; @@ -366,21 +320,35 @@ this.rePrintBtn.WithStataHode = false; this.rePrintBtn.Click += new System.EventHandler(this.rePrintBtn_Click); // + // groupBox1 + // + this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBox1.Controls.Add(this.historyDataGrid); + this.groupBox1.Controls.Add(this.uLabel3); + this.groupBox1.Location = new System.Drawing.Point(10, 174); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Padding = new System.Windows.Forms.Padding(5); + this.groupBox1.Size = new System.Drawing.Size(533, 332); + this.groupBox1.TabIndex = 5; + this.groupBox1.TabStop = false; + // // historyDataGrid // this.historyDataGrid.AllowUserToAddRows = false; this.historyDataGrid.AllowUserToDeleteRows = false; this.historyDataGrid.AllowUserToResizeColumns = false; this.historyDataGrid.AllowUserToResizeRows = false; - dataGridViewCellStyle67.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); - this.historyDataGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle67; + dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); + this.historyDataGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; this.historyDataGrid.BackgroundColor = System.Drawing.Color.White; this.historyDataGrid.BorderStyle = System.Windows.Forms.BorderStyle.None; - dataGridViewCellStyle68.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle68.Font = new System.Drawing.Font("宋体", 12F); - dataGridViewCellStyle68.ForeColor = System.Drawing.Color.White; - dataGridViewCellStyle68.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.historyDataGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle68; + dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle2.Font = new System.Drawing.Font("宋体", 12F); + dataGridViewCellStyle2.ForeColor = System.Drawing.Color.White; + dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.historyDataGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2; this.historyDataGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.historyDataGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.H_RowIndex, @@ -393,9 +361,9 @@ this.historyDataGrid.Name = "historyDataGrid"; this.historyDataGrid.ReadOnly = true; this.historyDataGrid.RowHeadersVisible = false; - dataGridViewCellStyle70.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle70.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); - this.historyDataGrid.RowsDefaultCellStyle = dataGridViewCellStyle70; + dataGridViewCellStyle4.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle4.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); + this.historyDataGrid.RowsDefaultCellStyle = dataGridViewCellStyle4; this.historyDataGrid.RowTemplate.Height = 23; this.historyDataGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.historyDataGrid.Size = new System.Drawing.Size(523, 308); @@ -428,8 +396,8 @@ // H_Weight // this.H_Weight.DataPropertyName = "Weight"; - dataGridViewCellStyle69.Format = "#0.######"; - this.H_Weight.DefaultCellStyle = dataGridViewCellStyle69; + dataGridViewCellStyle3.Format = "#0.######"; + this.H_Weight.DefaultCellStyle = dataGridViewCellStyle3; this.H_Weight.HeaderText = "重量"; this.H_Weight.Name = "H_Weight"; this.H_Weight.ReadOnly = true; @@ -445,21 +413,34 @@ this.uLabel3.TabIndex = 1; this.uLabel3.Text = "生产历史"; // + // groupBox2 + // + this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBox2.Controls.Add(this.taskDataGrid); + this.groupBox2.Controls.Add(this.GoodsLabel); + this.groupBox2.Location = new System.Drawing.Point(9, 8); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.Padding = new System.Windows.Forms.Padding(5); + this.groupBox2.Size = new System.Drawing.Size(533, 120); + this.groupBox2.TabIndex = 4; + this.groupBox2.TabStop = false; + // // taskDataGrid // this.taskDataGrid.AllowUserToAddRows = false; this.taskDataGrid.AllowUserToDeleteRows = false; this.taskDataGrid.AllowUserToResizeColumns = false; this.taskDataGrid.AllowUserToResizeRows = false; - dataGridViewCellStyle61.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); - this.taskDataGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle61; + dataGridViewCellStyle5.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); + this.taskDataGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle5; this.taskDataGrid.BackgroundColor = System.Drawing.Color.White; this.taskDataGrid.BorderStyle = System.Windows.Forms.BorderStyle.None; - dataGridViewCellStyle62.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle62.Font = new System.Drawing.Font("宋体", 12F); - dataGridViewCellStyle62.ForeColor = System.Drawing.Color.White; - dataGridViewCellStyle62.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.taskDataGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle62; + dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle6.Font = new System.Drawing.Font("宋体", 12F); + dataGridViewCellStyle6.ForeColor = System.Drawing.Color.White; + dataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.taskDataGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle6; this.taskDataGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.taskDataGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.T_Item, @@ -472,9 +453,9 @@ this.taskDataGrid.Name = "taskDataGrid"; this.taskDataGrid.ReadOnly = true; this.taskDataGrid.RowHeadersVisible = false; - dataGridViewCellStyle66.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle66.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); - this.taskDataGrid.RowsDefaultCellStyle = dataGridViewCellStyle66; + dataGridViewCellStyle10.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle10.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); + this.taskDataGrid.RowsDefaultCellStyle = dataGridViewCellStyle10; this.taskDataGrid.RowTemplate.Height = 23; this.taskDataGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.taskDataGrid.Size = new System.Drawing.Size(523, 96); @@ -491,8 +472,8 @@ // this.T_Need.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; this.T_Need.DataPropertyName = "Need"; - dataGridViewCellStyle63.Format = "#0.######"; - this.T_Need.DefaultCellStyle = dataGridViewCellStyle63; + dataGridViewCellStyle7.Format = "#0.######"; + this.T_Need.DefaultCellStyle = dataGridViewCellStyle7; this.T_Need.HeaderText = "订货"; this.T_Need.Name = "T_Need"; this.T_Need.ReadOnly = true; @@ -501,8 +482,8 @@ // this.T_Done.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; this.T_Done.DataPropertyName = "Done"; - dataGridViewCellStyle64.Format = "#0.######"; - this.T_Done.DefaultCellStyle = dataGridViewCellStyle64; + dataGridViewCellStyle8.Format = "#0.######"; + this.T_Done.DefaultCellStyle = dataGridViewCellStyle8; this.T_Done.HeaderText = "完工"; this.T_Done.Name = "T_Done"; this.T_Done.ReadOnly = true; @@ -511,8 +492,8 @@ // this.T_Last.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; this.T_Last.DataPropertyName = "Last"; - dataGridViewCellStyle65.Format = "#0.######"; - this.T_Last.DefaultCellStyle = dataGridViewCellStyle65; + dataGridViewCellStyle9.Format = "#0.######"; + this.T_Last.DefaultCellStyle = dataGridViewCellStyle9; this.T_Last.HeaderText = "剩余"; this.T_Last.Name = "T_Last"; this.T_Last.ReadOnly = true; @@ -552,6 +533,18 @@ this.trunOutBtn.WithStataHode = false; this.trunOutBtn.Click += new System.EventHandler(this.trunOutBtn_Click); // + // flowLayoutPanel2 + // + this.flowLayoutPanel2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.flowLayoutPanel2.AutoScroll = true; + this.flowLayoutPanel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.flowLayoutPanel2.Location = new System.Drawing.Point(-3, 125); + this.flowLayoutPanel2.Name = "flowLayoutPanel2"; + this.flowLayoutPanel2.Size = new System.Drawing.Size(670, 384); + this.flowLayoutPanel2.TabIndex = 21; + // // switchBtn // this.switchBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); @@ -621,6 +614,14 @@ this.endBtn.WithStataHode = false; this.endBtn.Click += new System.EventHandler(this.endBtn_Click); // + // flowLayoutPanel1 + // + this.flowLayoutPanel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.flowLayoutPanel1.Location = new System.Drawing.Point(-3, 49); + this.flowLayoutPanel1.Name = "flowLayoutPanel1"; + this.flowLayoutPanel1.Size = new System.Drawing.Size(547, 70); + this.flowLayoutPanel1.TabIndex = 0; + // // startBtn // this.startBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); @@ -664,9 +665,9 @@ this.splitContainer2.ResumeLayout(false); this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.historyDataGrid)).EndInit(); this.groupBox2.ResumeLayout(false); this.groupBox2.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.historyDataGrid)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.taskDataGrid)).EndInit(); this.ResumeLayout(false); diff --git a/ButcherFactory.Form/SegmentProduction_/SegmentProductionForm.cs b/ButcherFactory.Form/SegmentProduction_/SegmentProductionForm.cs index 6fab97c..56afd11 100644 --- a/ButcherFactory.Form/SegmentProduction_/SegmentProductionForm.cs +++ b/ButcherFactory.Form/SegmentProduction_/SegmentProductionForm.cs @@ -43,7 +43,8 @@ namespace ButcherFactory.SegmentProduction_ startBtn.Enabled = !start; endBtn.Enabled = start; } - + //GroupID 标识有没有结束,同时是总码的标识。 + //TrunOutID 标识挂起,同时标识挂起的组。 点击挂起 或者切换,需要给该字段赋值,点击切换回来,需要清空 public SegmentProductionForm() { InitializeComponent(); @@ -147,11 +148,15 @@ namespace ButcherFactory.SegmentProduction_ throw new Exception(string.Format("重量必须在{0:#0.######}-{1:#0.######}之间", detail.StandardWeightLow, detail.StandardWeightUp)); weight = detail.StandardWeight.Value; } + if (startBtn.Enabled) + Start(true); var entity = SegmentProductionBL.Insert(detail.Goods_ID, weight, workUnitID, batchID.Value, batchDate.Value); entity.Goods_Name = detail.Goods_Name; GoodsLabel.Text = entity.Goods_Name; unSubmitList.Insert(0, entity); historyList.Insert(0, entity); + if (historyList.Count > 100) + historyList.RemoveAt(100); historyDataGrid.FirstDisplayedScrollingRowIndex = 0; historyDataGrid.Refresh(); } @@ -168,7 +173,7 @@ namespace ButcherFactory.SegmentProduction_ historyDataGrid.DataSource = historyList; historyDataGrid.Refresh(); - var first = unSubmitList.FirstOrDefault(x => x.GroupID == null && !x.TrunOut); + var first = unSubmitList.FirstOrDefault(x => x.GroupID == null && x.TrunOutID == null); if (first == null) Start(false); else @@ -206,7 +211,7 @@ namespace ButcherFactory.SegmentProduction_ private void endBtn_Click(object sender, EventArgs e) { - var arr = unSubmitList.Where(x => x.GroupID == null && !x.TrunOut); + var arr = unSubmitList.Where(x => x.GroupID == null && x.TrunOutID == null); if (arr.Any()) { var groupID = SegmentProductionBL.SetListGroupID(arr.Select(x => x.ID)); @@ -224,11 +229,15 @@ namespace ButcherFactory.SegmentProduction_ private void trunOutBtn_Click(object sender, EventArgs e) { - var arr = unSubmitList.Where(x => x.GroupID == null && !x.TrunOut); + var arr = unSubmitList.Where(x => x.GroupID == null && x.TrunOutID == null); + long id = 0; if (arr.Any()) - SegmentProductionBL.BatchUpdate(arr.Select(x => x.ID), new Tuple("TrunOut", true)); + { + id = arr.First().ID; + SegmentProductionBL.BatchUpdate(arr.Select(x => x.ID), new Tuple("TrunOutID", id)); + } foreach (var item in arr) - item.TrunOut = true; + item.TrunOutID = id; GoodsLabel.Text = string.Empty; Start(false); } @@ -236,19 +245,19 @@ namespace ButcherFactory.SegmentProduction_ private void switchBtn_Click(object sender, EventArgs e) { trunOutBtn_Click(sender, e); - var arr = unSubmitList.Where(x => x.GroupID == null); + var arr = unSubmitList.Where(x => x.GroupID == null && x.TrunOutID.HasValue); var r = new BindingList(); - foreach (var item in arr.GroupBy(x => x.Goods_Name)) + foreach (var item in arr.GroupBy(x => x.TrunOutID)) r.Add(item.First()); var dialog = new TrunOutDialog(r); if (dialog.ShowDialog() == DialogResult.OK) { - var gName = dialog.backGoodsName; - var targets = arr.Where(x => x.Goods_Name == gName); - SegmentProductionBL.BatchUpdate(targets.Select(x => x.ID), new Tuple("TrunOut", false)); + var back = dialog.Back; + var targets = arr.Where(x => x.TrunOutID == back.TrunOutID); + SegmentProductionBL.TrunBack(targets.Select(x => x.ID)); foreach (var item in targets) - item.TrunOut = false; - GoodsLabel.Text = gName; + item.TrunOutID = null; + GoodsLabel.Text = back.Goods_Name; Start(true); } } @@ -270,7 +279,7 @@ namespace ButcherFactory.SegmentProduction_ private void submitBtn_Click(object sender, EventArgs e) { - var arrs = unSubmitList.Where(x => x.GroupID.HasValue && !x.TrunOut).ToList(); + var arrs = unSubmitList.Where(x => x.GroupID.HasValue).ToList(); if (arrs.Any()) { SegmentProductionBL.BatchUpdate(arrs.Select(x => x.ID), new Tuple("Submited", true)); diff --git a/ButcherFactory.Form/SegmentProduction_/SegmentProductionForm.resx b/ButcherFactory.Form/SegmentProduction_/SegmentProductionForm.resx index 1cdee8d..fd9315b 100644 --- a/ButcherFactory.Form/SegmentProduction_/SegmentProductionForm.resx +++ b/ButcherFactory.Form/SegmentProduction_/SegmentProductionForm.resx @@ -150,6 +150,9 @@ KAgKgoKg1ZsPvpCB0hBohjQAAAAASUVORK5CYII= + + True + True @@ -193,7 +196,4 @@ KAgKgoKg1ZsPvpCB0hBohjQAAAAASUVORK5CYII= - - True - \ No newline at end of file diff --git a/ButcherFactory.Form/SegmentProduction_/TrunOutDialog.Designer.cs b/ButcherFactory.Form/SegmentProduction_/TrunOutDialog.Designer.cs index 5aee20c..500754f 100644 --- a/ButcherFactory.Form/SegmentProduction_/TrunOutDialog.Designer.cs +++ b/ButcherFactory.Form/SegmentProduction_/TrunOutDialog.Designer.cs @@ -35,6 +35,7 @@ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); this.closeBtn = new WinFormControl.UButton(); this.uDataGridView1 = new WinFormControl.UDataGridView(); + this.G_TrunOutID = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.G_Goods_Name = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.G_CreateTime = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.G_GoBack = new System.Windows.Forms.DataGridViewButtonColumn(); @@ -81,6 +82,7 @@ this.uDataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2; this.uDataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.uDataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.G_TrunOutID, this.G_Goods_Name, this.G_CreateTime, this.G_GoBack}); @@ -97,6 +99,14 @@ this.uDataGridView1.Size = new System.Drawing.Size(595, 329); this.uDataGridView1.TabIndex = 17; // + // G_TrunOutID + // + this.G_TrunOutID.DataPropertyName = "TrunOutID"; + this.G_TrunOutID.HeaderText = "TrunOutID"; + this.G_TrunOutID.Name = "G_TrunOutID"; + this.G_TrunOutID.ReadOnly = true; + this.G_TrunOutID.Visible = false; + // // G_Goods_Name // this.G_Goods_Name.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; @@ -144,6 +154,7 @@ private WinFormControl.UButton closeBtn; private WinFormControl.UDataGridView uDataGridView1; + private System.Windows.Forms.DataGridViewTextBoxColumn G_TrunOutID; private System.Windows.Forms.DataGridViewTextBoxColumn G_Goods_Name; private System.Windows.Forms.DataGridViewTextBoxColumn G_CreateTime; private System.Windows.Forms.DataGridViewButtonColumn G_GoBack; diff --git a/ButcherFactory.Form/SegmentProduction_/TrunOutDialog.cs b/ButcherFactory.Form/SegmentProduction_/TrunOutDialog.cs index 33bb547..aec5674 100644 --- a/ButcherFactory.Form/SegmentProduction_/TrunOutDialog.cs +++ b/ButcherFactory.Form/SegmentProduction_/TrunOutDialog.cs @@ -13,7 +13,7 @@ namespace ButcherFactory.SegmentProduction_ { public partial class TrunOutDialog : Form { - public string backGoodsName; + public SegmentProduction Back; BindingList list; public TrunOutDialog(BindingList trunOutList) { @@ -31,9 +31,9 @@ namespace ButcherFactory.SegmentProduction_ void uDataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { - if (e.ColumnIndex != 2) + if (e.ColumnIndex != 3) return; - backGoodsName = (string)uDataGridView1.CurrentRow.Cells[0].Value; + Back = uDataGridView1.CurrentRow.DataBoundItem as SegmentProduction; DialogResult = DialogResult.OK; this.Close(); } diff --git a/ButcherFactory.Form/SegmentProduction_/TrunOutDialog.resx b/ButcherFactory.Form/SegmentProduction_/TrunOutDialog.resx index c15a01c..20800bb 100644 --- a/ButcherFactory.Form/SegmentProduction_/TrunOutDialog.resx +++ b/ButcherFactory.Form/SegmentProduction_/TrunOutDialog.resx @@ -126,6 +126,9 @@ KAgKgoKg1ZsPvpCB0hBohjQAAAAASUVORK5CYII= + + True + True