From b840423c8fafaf0251c712a74b17e4e21258258c Mon Sep 17 00:00:00 2001 From: yibo <361071264@qq.com> Date: Wed, 21 Mar 2018 07:56:39 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ButcherOrder/ButcherOrderForm.Designer.cs | 27 +++ ButcherOrder/ButcherOrderForm.cs | 8 + ButcherWeight/WeightForm.cs | 2 + WeighAndGrading/DataViewForm.Designer.cs | 268 +++++++++++++--------- WeighAndGrading/DataViewForm.cs | 2 + 5 files changed, 200 insertions(+), 107 deletions(-) diff --git a/ButcherOrder/ButcherOrderForm.Designer.cs b/ButcherOrder/ButcherOrderForm.Designer.cs index 43e7c42..9da61d8 100644 --- a/ButcherOrder/ButcherOrderForm.Designer.cs +++ b/ButcherOrder/ButcherOrderForm.Designer.cs @@ -54,6 +54,8 @@ this.updateBtn = new System.Windows.Forms.DataGridViewButtonColumn(); this.viewBtn = new System.Windows.Forms.DataGridViewButtonColumn(); this.uDatePicker1 = new BWP.WinFormControl.UDatePicker(); + this.tangTotal = new System.Windows.Forms.Label(); + this.label5 = new System.Windows.Forms.Label(); ((System.ComponentModel.ISupportInitialize)(this.secondOrderGridView)).BeginInit(); this.SuspendLayout(); // @@ -290,11 +292,34 @@ this.uDatePicker1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; this.uDatePicker1.Type = BWP.WinFormControl.DateTimeType.Date; // + // tangTotal + // + this.tangTotal.AutoSize = true; + this.tangTotal.Font = new System.Drawing.Font("宋体", 18F); + this.tangTotal.ForeColor = System.Drawing.Color.Red; + this.tangTotal.Location = new System.Drawing.Point(769, 24); + this.tangTotal.Name = "tangTotal"; + this.tangTotal.Size = new System.Drawing.Size(22, 24); + this.tangTotal.TabIndex = 53; + this.tangTotal.Text = "0"; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Font = new System.Drawing.Font("宋体", 15F); + this.label5.Location = new System.Drawing.Point(671, 28); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(109, 20); + this.label5.TabIndex = 52; + this.label5.Text = "烫褪合计:"; + // // ButcherOrderForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(1020, 690); + this.Controls.Add(this.tangTotal); + this.Controls.Add(this.label5); this.Controls.Add(this.vScrollBar1); this.Controls.Add(this.secondOrderGridView); this.Controls.Add(this.okBtn); @@ -341,5 +366,7 @@ private System.Windows.Forms.DataGridViewTextBoxColumn HotFadeNumber; private System.Windows.Forms.DataGridViewButtonColumn updateBtn; private System.Windows.Forms.DataGridViewButtonColumn viewBtn; + private System.Windows.Forms.Label tangTotal; + private System.Windows.Forms.Label label5; } } \ No newline at end of file diff --git a/ButcherOrder/ButcherOrderForm.cs b/ButcherOrder/ButcherOrderForm.cs index 15371b2..097d89c 100644 --- a/ButcherOrder/ButcherOrderForm.cs +++ b/ButcherOrder/ButcherOrderForm.cs @@ -107,12 +107,18 @@ namespace ButcherOrder this.Invoke(new InvokeHandler(delegate() { orderList = SecondOrderRpc.GetSecondOrderList(this.uDatePicker1.Date.Value); + BindTotalHotFadeNumber(); BindGrid(); })); Thread.Sleep(5000); } } + void BindTotalHotFadeNumber() + { + tangTotal.Text = orderList.Sum(x => x.HotFadeNumber).ToString(); + } + SecondOrder last; void BindGrid() { @@ -173,6 +179,7 @@ namespace ButcherOrder last.HotFadeNumber += detail.Number; SecondOrderRpc.Insert(detail, last); secondOrderGridView.Refresh(); + BindTotalHotFadeNumber(); numberInput.Text = string.Empty; } @@ -200,6 +207,7 @@ namespace ButcherOrder { entity.HotFadeNumber = view.HotFadeNumber; secondOrderGridView.Refresh(); + BindTotalHotFadeNumber(); } } } diff --git a/ButcherWeight/WeightForm.cs b/ButcherWeight/WeightForm.cs index 3a5b1e2..dd57a20 100644 --- a/ButcherWeight/WeightForm.cs +++ b/ButcherWeight/WeightForm.cs @@ -154,6 +154,8 @@ namespace ButcherWeight private void commitBtn_Click(object sender, EventArgs e) { + if (Dmo.PrintNumber > 0) + throw new Exception("已打印过,不允许修改!"); if (!_details.Any()) throw new Exception("没有称重记录"); //if (!_farmerDetails.Any()) diff --git a/WeighAndGrading/DataViewForm.Designer.cs b/WeighAndGrading/DataViewForm.Designer.cs index 34067f1..d8b7c81 100644 --- a/WeighAndGrading/DataViewForm.Designer.cs +++ b/WeighAndGrading/DataViewForm.Designer.cs @@ -65,6 +65,12 @@ this.ttPanel = new System.Windows.Forms.FlowLayoutPanel(); this.lblTangTui = new System.Windows.Forms.Label(); this.tangGridView = new BWP.WinFormControl.UDataGridView(); + this.T_OrderDetail_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.T_Finish = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.T_WeightID = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.T_Order = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.T_Number = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.T_Already = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.alreadyLabel = new System.Windows.Forms.Label(); this.label4 = new System.Windows.Forms.Label(); this.orderLabel = new System.Windows.Forms.Label(); @@ -78,6 +84,12 @@ this.label3 = new System.Windows.Forms.Label(); this.maoScrollBar = new System.Windows.Forms.VScrollBar(); this.maoGridView = new BWP.WinFormControl.UDataGridView(); + this.M_OrderDetail_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.M_Finish = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.M_WeightID = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.M_Order = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.M_Number = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.M_Already = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.mbPanel = new System.Windows.Forms.FlowLayoutPanel(); this.keyPanel = new System.Windows.Forms.FlowLayoutPanel(); this.lblMaoBo = new System.Windows.Forms.Label(); @@ -86,18 +98,10 @@ this.statePic = new System.Windows.Forms.PictureBox(); this.printBtn = new System.Windows.Forms.Button(); this.isPrintCheckBox = new System.Windows.Forms.CheckBox(); - this.T_OrderDetail_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.T_Finish = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.T_WeightID = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.T_Order = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.T_Number = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.T_Already = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.M_OrderDetail_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.M_Finish = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.M_WeightID = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.M_Order = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.M_Number = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.M_Already = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.maoTotal = new System.Windows.Forms.Label(); + this.label6 = new System.Windows.Forms.Label(); + this.tangTotal = new System.Windows.Forms.Label(); + this.label8 = new System.Windows.Forms.Label(); this.modifyPanel.SuspendLayout(); this.withOkPanel.SuspendLayout(); this.groupBox1.SuspendLayout(); @@ -309,6 +313,8 @@ // // groupBox1 // + this.groupBox1.Controls.Add(this.tangTotal); + this.groupBox1.Controls.Add(this.label8); this.groupBox1.Controls.Add(this.tangScrollBar); this.groupBox1.Controls.Add(this.ttPanel); this.groupBox1.Controls.Add(this.lblTangTui); @@ -386,6 +392,54 @@ this.tangGridView.TabIndex = 4; this.tangGridView.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.tangGridView_CellClick); // + // T_OrderDetail_ID + // + this.T_OrderDetail_ID.DataPropertyName = "OrderDetail_ID"; + this.T_OrderDetail_ID.HeaderText = "OrderDetail_ID"; + this.T_OrderDetail_ID.Name = "T_OrderDetail_ID"; + this.T_OrderDetail_ID.ReadOnly = true; + this.T_OrderDetail_ID.Visible = false; + // + // T_Finish + // + this.T_Finish.DataPropertyName = "Finish"; + this.T_Finish.HeaderText = "Finish"; + this.T_Finish.Name = "T_Finish"; + this.T_Finish.ReadOnly = true; + this.T_Finish.Visible = false; + // + // T_WeightID + // + this.T_WeightID.DataPropertyName = "WeightID"; + this.T_WeightID.HeaderText = "磅单号"; + this.T_WeightID.Name = "T_WeightID"; + this.T_WeightID.ReadOnly = true; + this.T_WeightID.Width = 90; + // + // T_Order + // + this.T_Order.DataPropertyName = "Order"; + this.T_Order.HeaderText = "顺序号"; + this.T_Order.Name = "T_Order"; + this.T_Order.ReadOnly = true; + this.T_Order.Width = 90; + // + // T_Number + // + this.T_Number.DataPropertyName = "Number"; + this.T_Number.HeaderText = "头数"; + this.T_Number.Name = "T_Number"; + this.T_Number.ReadOnly = true; + this.T_Number.Width = 85; + // + // T_Already + // + this.T_Already.DataPropertyName = "Already"; + this.T_Already.HeaderText = "已宰"; + this.T_Already.Name = "T_Already"; + this.T_Already.ReadOnly = true; + this.T_Already.Width = 85; + // // alreadyLabel // this.alreadyLabel.AutoSize = true; @@ -517,7 +571,9 @@ // // groupBox2 // + this.groupBox2.Controls.Add(this.maoTotal); this.groupBox2.Controls.Add(this.label3); + this.groupBox2.Controls.Add(this.label6); this.groupBox2.Controls.Add(this.maoScrollBar); this.groupBox2.Controls.Add(this.maoGridView); this.groupBox2.Controls.Add(this.mbPanel); @@ -587,6 +643,54 @@ this.maoGridView.TabIndex = 33; this.maoGridView.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.maoGridView_CellClick); // + // M_OrderDetail_ID + // + this.M_OrderDetail_ID.DataPropertyName = "OrderDetail_ID"; + this.M_OrderDetail_ID.HeaderText = "OrderDetail_ID"; + this.M_OrderDetail_ID.Name = "M_OrderDetail_ID"; + this.M_OrderDetail_ID.ReadOnly = true; + this.M_OrderDetail_ID.Visible = false; + // + // M_Finish + // + this.M_Finish.DataPropertyName = "Finish"; + this.M_Finish.HeaderText = "Finish"; + this.M_Finish.Name = "M_Finish"; + this.M_Finish.ReadOnly = true; + this.M_Finish.Visible = false; + // + // M_WeightID + // + this.M_WeightID.DataPropertyName = "WeightID"; + this.M_WeightID.HeaderText = "磅单号"; + this.M_WeightID.Name = "M_WeightID"; + this.M_WeightID.ReadOnly = true; + this.M_WeightID.Width = 90; + // + // M_Order + // + this.M_Order.DataPropertyName = "Order"; + this.M_Order.HeaderText = "顺序号"; + this.M_Order.Name = "M_Order"; + this.M_Order.ReadOnly = true; + this.M_Order.Width = 90; + // + // M_Number + // + this.M_Number.DataPropertyName = "Number"; + this.M_Number.HeaderText = "头数"; + this.M_Number.Name = "M_Number"; + this.M_Number.ReadOnly = true; + this.M_Number.Width = 85; + // + // M_Already + // + this.M_Already.DataPropertyName = "Already"; + this.M_Already.HeaderText = "已宰"; + this.M_Already.Name = "M_Already"; + this.M_Already.ReadOnly = true; + this.M_Already.Width = 85; + // // mbPanel // this.mbPanel.Location = new System.Drawing.Point(431, 35); @@ -665,101 +769,47 @@ this.isPrintCheckBox.Text = "打印条码"; this.isPrintCheckBox.UseVisualStyleBackColor = true; // - // T_OrderDetail_ID - // - this.T_OrderDetail_ID.DataPropertyName = "OrderDetail_ID"; - this.T_OrderDetail_ID.HeaderText = "OrderDetail_ID"; - this.T_OrderDetail_ID.Name = "T_OrderDetail_ID"; - this.T_OrderDetail_ID.ReadOnly = true; - this.T_OrderDetail_ID.Visible = false; - // - // T_Finish - // - this.T_Finish.DataPropertyName = "Finish"; - this.T_Finish.HeaderText = "Finish"; - this.T_Finish.Name = "T_Finish"; - this.T_Finish.ReadOnly = true; - this.T_Finish.Visible = false; - // - // T_WeightID - // - this.T_WeightID.DataPropertyName = "WeightID"; - this.T_WeightID.HeaderText = "磅单号"; - this.T_WeightID.Name = "T_WeightID"; - this.T_WeightID.ReadOnly = true; - this.T_WeightID.Width = 90; - // - // T_Order - // - this.T_Order.DataPropertyName = "Order"; - this.T_Order.HeaderText = "顺序号"; - this.T_Order.Name = "T_Order"; - this.T_Order.ReadOnly = true; - this.T_Order.Width = 90; - // - // T_Number - // - this.T_Number.DataPropertyName = "Number"; - this.T_Number.HeaderText = "头数"; - this.T_Number.Name = "T_Number"; - this.T_Number.ReadOnly = true; - this.T_Number.Width = 85; - // - // T_Already - // - this.T_Already.DataPropertyName = "Already"; - this.T_Already.HeaderText = "已宰"; - this.T_Already.Name = "T_Already"; - this.T_Already.ReadOnly = true; - this.T_Already.Width = 85; - // - // M_OrderDetail_ID - // - this.M_OrderDetail_ID.DataPropertyName = "OrderDetail_ID"; - this.M_OrderDetail_ID.HeaderText = "OrderDetail_ID"; - this.M_OrderDetail_ID.Name = "M_OrderDetail_ID"; - this.M_OrderDetail_ID.ReadOnly = true; - this.M_OrderDetail_ID.Visible = false; - // - // M_Finish - // - this.M_Finish.DataPropertyName = "Finish"; - this.M_Finish.HeaderText = "Finish"; - this.M_Finish.Name = "M_Finish"; - this.M_Finish.ReadOnly = true; - this.M_Finish.Visible = false; - // - // M_WeightID - // - this.M_WeightID.DataPropertyName = "WeightID"; - this.M_WeightID.HeaderText = "磅单号"; - this.M_WeightID.Name = "M_WeightID"; - this.M_WeightID.ReadOnly = true; - this.M_WeightID.Width = 90; - // - // M_Order - // - this.M_Order.DataPropertyName = "Order"; - this.M_Order.HeaderText = "顺序号"; - this.M_Order.Name = "M_Order"; - this.M_Order.ReadOnly = true; - this.M_Order.Width = 90; - // - // M_Number - // - this.M_Number.DataPropertyName = "Number"; - this.M_Number.HeaderText = "头数"; - this.M_Number.Name = "M_Number"; - this.M_Number.ReadOnly = true; - this.M_Number.Width = 85; - // - // M_Already - // - this.M_Already.DataPropertyName = "Already"; - this.M_Already.HeaderText = "已宰"; - this.M_Already.Name = "M_Already"; - this.M_Already.ReadOnly = true; - this.M_Already.Width = 85; + // maoTotal + // + this.maoTotal.AutoSize = true; + this.maoTotal.Font = new System.Drawing.Font("宋体", 18F); + this.maoTotal.ForeColor = System.Drawing.Color.Red; + this.maoTotal.Location = new System.Drawing.Point(312, -5); + this.maoTotal.Name = "maoTotal"; + this.maoTotal.Size = new System.Drawing.Size(22, 24); + this.maoTotal.TabIndex = 53; + this.maoTotal.Text = "0"; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Font = new System.Drawing.Font("宋体", 15F); + this.label6.Location = new System.Drawing.Point(207, -1); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(109, 20); + this.label6.TabIndex = 52; + this.label6.Text = "已宰合计:"; + // + // tangTotal + // + this.tangTotal.AutoSize = true; + this.tangTotal.Font = new System.Drawing.Font("宋体", 18F); + this.tangTotal.ForeColor = System.Drawing.Color.Red; + this.tangTotal.Location = new System.Drawing.Point(312, -5); + this.tangTotal.Name = "tangTotal"; + this.tangTotal.Size = new System.Drawing.Size(22, 24); + this.tangTotal.TabIndex = 55; + this.tangTotal.Text = "0"; + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Font = new System.Drawing.Font("宋体", 15F); + this.label8.Location = new System.Drawing.Point(207, -1); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(109, 20); + this.label8.TabIndex = 54; + this.label8.Text = "已宰合计:"; // // DataViewForm // @@ -871,5 +921,9 @@ private System.Windows.Forms.DataGridViewTextBoxColumn M_Order; private System.Windows.Forms.DataGridViewTextBoxColumn M_Number; private System.Windows.Forms.DataGridViewTextBoxColumn M_Already; + private System.Windows.Forms.Label tangTotal; + private System.Windows.Forms.Label label8; + private System.Windows.Forms.Label maoTotal; + private System.Windows.Forms.Label label6; } } \ No newline at end of file diff --git a/WeighAndGrading/DataViewForm.cs b/WeighAndGrading/DataViewForm.cs index 66144f9..aa1ee38 100644 --- a/WeighAndGrading/DataViewForm.cs +++ b/WeighAndGrading/DataViewForm.cs @@ -326,6 +326,7 @@ namespace WeighAndGrading void BindTangGrid() { tangGridView.DataSource = tangList.OrderBy(x => x.Order).OrderBy(x => x.Finish).ToList(); + tangTotal.Text = tangList.Sum(x => x.Already).ToString(); if (tangEntity == null && tangGridView.CurrentRow != null) { tangEntity = tangGridView.CurrentRow.DataBoundItem as GradeAndWeight; @@ -360,6 +361,7 @@ namespace WeighAndGrading void BindMaoGrid() { maoGridView.DataSource = maoList.OrderBy(x => x.Order).OrderBy(x => x.Finish).ToList(); + maoTotal.Text = maoList.Sum(x => x.Already).ToString(); if (maoEntity == null && maoGridView.CurrentRow != null) { maoEntity = maoGridView.CurrentRow.DataBoundItem as GradeAndWeight;