diff --git a/ButcherWeight/WeightForm.Designer.cs b/ButcherWeight/WeightForm.Designer.cs index d8048f8..9895a46 100644 --- a/ButcherWeight/WeightForm.Designer.cs +++ b/ButcherWeight/WeightForm.Designer.cs @@ -32,11 +32,13 @@ this.components = new System.ComponentModel.Container(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = 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(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle13 = new System.Windows.Forms.DataGridViewCellStyle(); @@ -44,11 +46,10 @@ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle15 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle16 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle19 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle18 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = 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 dataGridViewCellStyle20 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle19 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); this.panel1 = new System.Windows.Forms.Panel(); this.enableCheckBox = new System.Windows.Forms.CheckBox(); this.weightSet = new System.Windows.Forms.Button(); @@ -102,9 +103,29 @@ this.label3 = new System.Windows.Forms.Label(); this.label18 = new System.Windows.Forms.Label(); this.weightGrid = new System.Windows.Forms.DataGridView(); + this.D_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.D_WeightBill_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.D_Index = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.D_Number = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.D_MaoWeight = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.D_PiWeight = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.D_Weight = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.panel4 = new System.Windows.Forms.Panel(); this.houseGird = new System.Windows.Forms.DataGridView(); + this.H_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.H_WeightBill_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.H_LiveColonyHouse_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.H_Index = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.H_LiveColonyHouse_Name = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.H_Number = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.abnormalGrid = new System.Windows.Forms.DataGridView(); + this.S_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.S_WeightBill_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.S_Sanction_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.S_AbnormalItem_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.S_Index = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.S_AbnormalItem_Name = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.S_Number = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.billGrid = new System.Windows.Forms.DataGridView(); this.M_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.M_FinishWeight = new System.Windows.Forms.DataGridViewTextBoxColumn(); @@ -139,26 +160,6 @@ this.F_Farmer_Name = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.F_Number = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.F_Weight = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.D_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.D_WeightBill_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.D_Index = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.D_Number = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.D_MaoWeight = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.D_PiWeight = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.D_Weight = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.H_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.H_WeightBill_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.H_LiveColonyHouse_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.H_Index = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.H_LiveColonyHouse_Name = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.H_Number = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.S_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.S_WeightBill_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.S_Sanction_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.S_AbnormalItem_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.S_Index = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.S_AbnormalItem_Name = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.S_Number = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.panel1.SuspendLayout(); this.panel2.SuspendLayout(); this.panel3.SuspendLayout(); @@ -783,8 +784,8 @@ this.farmerGrid.MultiSelect = false; this.farmerGrid.Name = "farmerGrid"; this.farmerGrid.RowHeadersVisible = false; - dataGridViewCellStyle3.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); - this.farmerGrid.RowsDefaultCellStyle = dataGridViewCellStyle3; + dataGridViewCellStyle4.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); + this.farmerGrid.RowsDefaultCellStyle = dataGridViewCellStyle4; this.farmerGrid.RowTemplate.Height = 23; this.farmerGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.farmerGrid.Size = new System.Drawing.Size(400, 112); @@ -815,19 +816,20 @@ // weightGrid // this.weightGrid.AllowUserToAddRows = false; + this.weightGrid.AllowUserToDeleteRows = false; this.weightGrid.AllowUserToResizeColumns = false; this.weightGrid.AllowUserToResizeRows = false; - dataGridViewCellStyle4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); - this.weightGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle4; + dataGridViewCellStyle5.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); + this.weightGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle5; this.weightGrid.BackgroundColor = System.Drawing.Color.White; - dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle5.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle5.Font = new System.Drawing.Font("宋体", 12F); - dataGridViewCellStyle5.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle5.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle5.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.weightGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle5; + dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle6.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle6.Font = new System.Drawing.Font("宋体", 12F); + dataGridViewCellStyle6.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle6.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle6.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.weightGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle6; this.weightGrid.ColumnHeadersHeight = 24; this.weightGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; this.weightGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { @@ -842,13 +844,72 @@ this.weightGrid.MultiSelect = false; this.weightGrid.Name = "weightGrid"; this.weightGrid.RowHeadersVisible = false; - dataGridViewCellStyle9.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); - this.weightGrid.RowsDefaultCellStyle = dataGridViewCellStyle9; + dataGridViewCellStyle10.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); + this.weightGrid.RowsDefaultCellStyle = dataGridViewCellStyle10; this.weightGrid.RowTemplate.Height = 23; this.weightGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.weightGrid.Size = new System.Drawing.Size(400, 90); this.weightGrid.TabIndex = 0; // + // D_ID + // + this.D_ID.DataPropertyName = "ID"; + this.D_ID.HeaderText = "ID"; + this.D_ID.Name = "D_ID"; + this.D_ID.Visible = false; + // + // D_WeightBill_ID + // + this.D_WeightBill_ID.DataPropertyName = "WeightBill_ID"; + this.D_WeightBill_ID.HeaderText = "WeightBill_ID"; + this.D_WeightBill_ID.Name = "D_WeightBill_ID"; + this.D_WeightBill_ID.Visible = false; + // + // D_Index + // + this.D_Index.DataPropertyName = "Index"; + this.D_Index.HeaderText = "序号"; + this.D_Index.Name = "D_Index"; + this.D_Index.ReadOnly = true; + this.D_Index.Width = 55; + // + // D_Number + // + this.D_Number.DataPropertyName = "Number"; + this.D_Number.HeaderText = "头数"; + this.D_Number.Name = "D_Number"; + this.D_Number.Width = 75; + // + // D_MaoWeight + // + this.D_MaoWeight.DataPropertyName = "MaoWeight"; + dataGridViewCellStyle7.Format = "#0.######"; + this.D_MaoWeight.DefaultCellStyle = dataGridViewCellStyle7; + this.D_MaoWeight.HeaderText = "毛重"; + this.D_MaoWeight.Name = "D_MaoWeight"; + this.D_MaoWeight.ReadOnly = true; + this.D_MaoWeight.Width = 88; + // + // D_PiWeight + // + this.D_PiWeight.DataPropertyName = "PiWeight"; + dataGridViewCellStyle8.Format = "#0.######"; + this.D_PiWeight.DefaultCellStyle = dataGridViewCellStyle8; + this.D_PiWeight.HeaderText = "皮重"; + this.D_PiWeight.Name = "D_PiWeight"; + this.D_PiWeight.ReadOnly = true; + this.D_PiWeight.Width = 88; + // + // D_Weight + // + this.D_Weight.DataPropertyName = "Weight"; + dataGridViewCellStyle9.Format = "#0.######"; + this.D_Weight.DefaultCellStyle = dataGridViewCellStyle9; + this.D_Weight.HeaderText = "重量"; + this.D_Weight.Name = "D_Weight"; + this.D_Weight.ReadOnly = true; + this.D_Weight.Width = 88; + // // panel4 // this.panel4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; @@ -864,17 +925,17 @@ this.houseGird.AllowUserToDeleteRows = false; this.houseGird.AllowUserToResizeColumns = false; this.houseGird.AllowUserToResizeRows = false; - dataGridViewCellStyle10.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); - this.houseGird.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle10; + dataGridViewCellStyle11.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); + this.houseGird.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle11; this.houseGird.BackgroundColor = System.Drawing.Color.White; - dataGridViewCellStyle11.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle11.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle11.Font = new System.Drawing.Font("宋体", 12F); - dataGridViewCellStyle11.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle11.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle11.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle11.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.houseGird.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle11; + dataGridViewCellStyle12.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle12.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle12.Font = new System.Drawing.Font("宋体", 12F); + dataGridViewCellStyle12.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle12.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle12.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle12.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.houseGird.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle12; this.houseGird.ColumnHeadersHeight = 24; this.houseGird.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; this.houseGird.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { @@ -888,30 +949,74 @@ this.houseGird.MultiSelect = false; this.houseGird.Name = "houseGird"; this.houseGird.RowHeadersVisible = false; - dataGridViewCellStyle12.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); - this.houseGird.RowsDefaultCellStyle = dataGridViewCellStyle12; + dataGridViewCellStyle13.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); + this.houseGird.RowsDefaultCellStyle = dataGridViewCellStyle13; this.houseGird.RowTemplate.Height = 23; this.houseGird.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.houseGird.Size = new System.Drawing.Size(400, 90); this.houseGird.TabIndex = 1; // + // H_ID + // + this.H_ID.DataPropertyName = "ID"; + this.H_ID.HeaderText = "ID"; + this.H_ID.Name = "H_ID"; + this.H_ID.Visible = false; + // + // H_WeightBill_ID + // + this.H_WeightBill_ID.DataPropertyName = "WeightBill_ID"; + this.H_WeightBill_ID.HeaderText = "WeightBill_ID"; + this.H_WeightBill_ID.Name = "H_WeightBill_ID"; + this.H_WeightBill_ID.Visible = false; + // + // H_LiveColonyHouse_ID + // + this.H_LiveColonyHouse_ID.DataPropertyName = "LiveColonyHouse_ID"; + this.H_LiveColonyHouse_ID.HeaderText = "LiveColonyHouse_ID"; + this.H_LiveColonyHouse_ID.Name = "H_LiveColonyHouse_ID"; + this.H_LiveColonyHouse_ID.Visible = false; + // + // H_Index + // + this.H_Index.DataPropertyName = "Index"; + this.H_Index.HeaderText = "序号"; + this.H_Index.Name = "H_Index"; + this.H_Index.ReadOnly = true; + this.H_Index.Width = 80; + // + // H_LiveColonyHouse_Name + // + this.H_LiveColonyHouse_Name.DataPropertyName = "LiveColonyHouse_Name"; + this.H_LiveColonyHouse_Name.HeaderText = "圈舍"; + this.H_LiveColonyHouse_Name.Name = "H_LiveColonyHouse_Name"; + this.H_LiveColonyHouse_Name.ReadOnly = true; + this.H_LiveColonyHouse_Name.Width = 150; + // + // H_Number + // + this.H_Number.DataPropertyName = "Number"; + this.H_Number.HeaderText = "入圈头数"; + this.H_Number.Name = "H_Number"; + this.H_Number.Width = 130; + // // abnormalGrid // this.abnormalGrid.AllowUserToAddRows = false; this.abnormalGrid.AllowUserToDeleteRows = false; this.abnormalGrid.AllowUserToResizeColumns = false; this.abnormalGrid.AllowUserToResizeRows = false; - dataGridViewCellStyle13.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); - this.abnormalGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle13; + dataGridViewCellStyle14.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); + this.abnormalGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle14; this.abnormalGrid.BackgroundColor = System.Drawing.Color.White; - dataGridViewCellStyle14.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle14.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle14.Font = new System.Drawing.Font("宋体", 12F); - dataGridViewCellStyle14.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle14.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle14.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle14.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.abnormalGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle14; + dataGridViewCellStyle15.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle15.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle15.Font = new System.Drawing.Font("宋体", 12F); + dataGridViewCellStyle15.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle15.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle15.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle15.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.abnormalGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle15; this.abnormalGrid.ColumnHeadersHeight = 24; this.abnormalGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; this.abnormalGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { @@ -926,30 +1031,80 @@ this.abnormalGrid.MultiSelect = false; this.abnormalGrid.Name = "abnormalGrid"; this.abnormalGrid.RowHeadersVisible = false; - dataGridViewCellStyle15.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); - this.abnormalGrid.RowsDefaultCellStyle = dataGridViewCellStyle15; + dataGridViewCellStyle16.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); + this.abnormalGrid.RowsDefaultCellStyle = dataGridViewCellStyle16; this.abnormalGrid.RowTemplate.Height = 23; this.abnormalGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.abnormalGrid.Size = new System.Drawing.Size(400, 237); this.abnormalGrid.TabIndex = 1; // + // S_ID + // + this.S_ID.DataPropertyName = "ID"; + this.S_ID.HeaderText = "ID"; + this.S_ID.Name = "S_ID"; + this.S_ID.Visible = false; + // + // S_WeightBill_ID + // + this.S_WeightBill_ID.DataPropertyName = "WeightBill_ID"; + this.S_WeightBill_ID.HeaderText = "WeightBill_ID"; + this.S_WeightBill_ID.Name = "S_WeightBill_ID"; + this.S_WeightBill_ID.Visible = false; + // + // S_Sanction_ID + // + this.S_Sanction_ID.DataPropertyName = "Sanction_ID"; + this.S_Sanction_ID.HeaderText = "Sanction_ID"; + this.S_Sanction_ID.Name = "S_Sanction_ID"; + this.S_Sanction_ID.Visible = false; + // + // S_AbnormalItem_ID + // + this.S_AbnormalItem_ID.HeaderText = "AbnormalItem_ID"; + this.S_AbnormalItem_ID.Name = "S_AbnormalItem_ID"; + this.S_AbnormalItem_ID.Visible = false; + // + // S_Index + // + this.S_Index.DataPropertyName = "Index"; + this.S_Index.HeaderText = "序号"; + this.S_Index.Name = "S_Index"; + this.S_Index.ReadOnly = true; + this.S_Index.Width = 80; + // + // S_AbnormalItem_Name + // + this.S_AbnormalItem_Name.DataPropertyName = "AbnormalItem_Name"; + this.S_AbnormalItem_Name.HeaderText = "异常项目"; + this.S_AbnormalItem_Name.Name = "S_AbnormalItem_Name"; + this.S_AbnormalItem_Name.ReadOnly = true; + this.S_AbnormalItem_Name.Width = 150; + // + // S_Number + // + this.S_Number.DataPropertyName = "Number"; + this.S_Number.HeaderText = "头数"; + this.S_Number.Name = "S_Number"; + this.S_Number.Width = 130; + // // billGrid // this.billGrid.AllowUserToAddRows = false; this.billGrid.AllowUserToDeleteRows = false; this.billGrid.AllowUserToResizeColumns = false; this.billGrid.AllowUserToResizeRows = false; - dataGridViewCellStyle16.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); - this.billGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle16; + dataGridViewCellStyle17.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); + this.billGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle17; this.billGrid.BackgroundColor = System.Drawing.Color.White; - dataGridViewCellStyle17.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle17.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle17.Font = new System.Drawing.Font("宋体", 12F); - dataGridViewCellStyle17.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle17.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle17.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle17.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.billGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle17; + dataGridViewCellStyle18.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle18.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle18.Font = new System.Drawing.Font("宋体", 12F); + dataGridViewCellStyle18.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle18.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle18.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle18.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.billGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle18; this.billGrid.ColumnHeadersHeight = 24; this.billGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; this.billGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { @@ -970,8 +1125,8 @@ this.billGrid.Name = "billGrid"; this.billGrid.ReadOnly = true; this.billGrid.RowHeadersVisible = false; - dataGridViewCellStyle19.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); - this.billGrid.RowsDefaultCellStyle = dataGridViewCellStyle19; + dataGridViewCellStyle20.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); + this.billGrid.RowsDefaultCellStyle = dataGridViewCellStyle20; this.billGrid.RowTemplate.Height = 23; this.billGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.billGrid.Size = new System.Drawing.Size(1250, 230); @@ -1044,8 +1199,8 @@ // M_Weight // this.M_Weight.DataPropertyName = "Weight"; - dataGridViewCellStyle18.Format = "#0.######"; - this.M_Weight.DefaultCellStyle = dataGridViewCellStyle18; + dataGridViewCellStyle19.Format = "#0.######"; + this.M_Weight.DefaultCellStyle = dataGridViewCellStyle19; this.M_Weight.HeaderText = "收购重量"; this.M_Weight.Name = "M_Weight"; this.M_Weight.ReadOnly = true; @@ -1256,162 +1411,11 @@ // F_Weight // this.F_Weight.DataPropertyName = "Weight"; + dataGridViewCellStyle3.Format = "#0.######"; + this.F_Weight.DefaultCellStyle = dataGridViewCellStyle3; this.F_Weight.HeaderText = "重量"; this.F_Weight.Name = "F_Weight"; // - // D_ID - // - this.D_ID.DataPropertyName = "ID"; - this.D_ID.HeaderText = "ID"; - this.D_ID.Name = "D_ID"; - this.D_ID.Visible = false; - // - // D_WeightBill_ID - // - this.D_WeightBill_ID.DataPropertyName = "WeightBill_ID"; - this.D_WeightBill_ID.HeaderText = "WeightBill_ID"; - this.D_WeightBill_ID.Name = "D_WeightBill_ID"; - this.D_WeightBill_ID.Visible = false; - // - // D_Index - // - this.D_Index.DataPropertyName = "Index"; - this.D_Index.HeaderText = "序号"; - this.D_Index.Name = "D_Index"; - this.D_Index.ReadOnly = true; - this.D_Index.Width = 55; - // - // D_Number - // - this.D_Number.DataPropertyName = "Number"; - this.D_Number.HeaderText = "头数"; - this.D_Number.Name = "D_Number"; - this.D_Number.Width = 75; - // - // D_MaoWeight - // - this.D_MaoWeight.DataPropertyName = "MaoWeight"; - dataGridViewCellStyle6.Format = "#0.######"; - this.D_MaoWeight.DefaultCellStyle = dataGridViewCellStyle6; - this.D_MaoWeight.HeaderText = "毛重"; - this.D_MaoWeight.Name = "D_MaoWeight"; - this.D_MaoWeight.ReadOnly = true; - this.D_MaoWeight.Width = 88; - // - // D_PiWeight - // - this.D_PiWeight.DataPropertyName = "PiWeight"; - dataGridViewCellStyle7.Format = "#0.######"; - this.D_PiWeight.DefaultCellStyle = dataGridViewCellStyle7; - this.D_PiWeight.HeaderText = "皮重"; - this.D_PiWeight.Name = "D_PiWeight"; - this.D_PiWeight.ReadOnly = true; - this.D_PiWeight.Width = 88; - // - // D_Weight - // - this.D_Weight.DataPropertyName = "Weight"; - dataGridViewCellStyle8.Format = "#0.######"; - this.D_Weight.DefaultCellStyle = dataGridViewCellStyle8; - this.D_Weight.HeaderText = "重量"; - this.D_Weight.Name = "D_Weight"; - this.D_Weight.ReadOnly = true; - this.D_Weight.Width = 88; - // - // H_ID - // - this.H_ID.DataPropertyName = "ID"; - this.H_ID.HeaderText = "ID"; - this.H_ID.Name = "H_ID"; - this.H_ID.Visible = false; - // - // H_WeightBill_ID - // - this.H_WeightBill_ID.DataPropertyName = "WeightBill_ID"; - this.H_WeightBill_ID.HeaderText = "WeightBill_ID"; - this.H_WeightBill_ID.Name = "H_WeightBill_ID"; - this.H_WeightBill_ID.Visible = false; - // - // H_LiveColonyHouse_ID - // - this.H_LiveColonyHouse_ID.DataPropertyName = "LiveColonyHouse_ID"; - this.H_LiveColonyHouse_ID.HeaderText = "LiveColonyHouse_ID"; - this.H_LiveColonyHouse_ID.Name = "H_LiveColonyHouse_ID"; - this.H_LiveColonyHouse_ID.Visible = false; - // - // H_Index - // - this.H_Index.DataPropertyName = "Index"; - this.H_Index.HeaderText = "序号"; - this.H_Index.Name = "H_Index"; - this.H_Index.ReadOnly = true; - this.H_Index.Width = 80; - // - // H_LiveColonyHouse_Name - // - this.H_LiveColonyHouse_Name.DataPropertyName = "LiveColonyHouse_Name"; - this.H_LiveColonyHouse_Name.HeaderText = "圈舍"; - this.H_LiveColonyHouse_Name.Name = "H_LiveColonyHouse_Name"; - this.H_LiveColonyHouse_Name.ReadOnly = true; - this.H_LiveColonyHouse_Name.Width = 150; - // - // H_Number - // - this.H_Number.DataPropertyName = "Number"; - this.H_Number.HeaderText = "入圈头数"; - this.H_Number.Name = "H_Number"; - this.H_Number.Width = 130; - // - // S_ID - // - this.S_ID.DataPropertyName = "ID"; - this.S_ID.HeaderText = "ID"; - this.S_ID.Name = "S_ID"; - this.S_ID.Visible = false; - // - // S_WeightBill_ID - // - this.S_WeightBill_ID.DataPropertyName = "WeightBill_ID"; - this.S_WeightBill_ID.HeaderText = "WeightBill_ID"; - this.S_WeightBill_ID.Name = "S_WeightBill_ID"; - this.S_WeightBill_ID.Visible = false; - // - // S_Sanction_ID - // - this.S_Sanction_ID.DataPropertyName = "Sanction_ID"; - this.S_Sanction_ID.HeaderText = "Sanction_ID"; - this.S_Sanction_ID.Name = "S_Sanction_ID"; - this.S_Sanction_ID.Visible = false; - // - // S_AbnormalItem_ID - // - this.S_AbnormalItem_ID.HeaderText = "AbnormalItem_ID"; - this.S_AbnormalItem_ID.Name = "S_AbnormalItem_ID"; - this.S_AbnormalItem_ID.Visible = false; - // - // S_Index - // - this.S_Index.DataPropertyName = "Index"; - this.S_Index.HeaderText = "序号"; - this.S_Index.Name = "S_Index"; - this.S_Index.ReadOnly = true; - this.S_Index.Width = 80; - // - // S_AbnormalItem_Name - // - this.S_AbnormalItem_Name.DataPropertyName = "AbnormalItem_Name"; - this.S_AbnormalItem_Name.HeaderText = "异常项目"; - this.S_AbnormalItem_Name.Name = "S_AbnormalItem_Name"; - this.S_AbnormalItem_Name.ReadOnly = true; - this.S_AbnormalItem_Name.Width = 150; - // - // S_Number - // - this.S_Number.DataPropertyName = "Number"; - this.S_Number.HeaderText = "头数"; - this.S_Number.Name = "S_Number"; - this.S_Number.Width = 130; - // // WeightForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); @@ -1543,13 +1547,6 @@ private System.Windows.Forms.DataGridViewTextBoxColumn M_HouseNames; private System.Windows.Forms.DataGridViewTextBoxColumn M_SanctionNumber; private System.Windows.Forms.DataGridViewTextBoxColumn M_Remark; - private System.Windows.Forms.DataGridViewTextBoxColumn F_ID; - private System.Windows.Forms.DataGridViewTextBoxColumn F_WeightBill_ID; - private System.Windows.Forms.DataGridViewTextBoxColumn F_Farmer_ID; - private System.Windows.Forms.DataGridViewTextBoxColumn F_Index; - private System.Windows.Forms.DataGridViewTextBoxColumn F_Farmer_Name; - private System.Windows.Forms.DataGridViewTextBoxColumn F_Number; - private System.Windows.Forms.DataGridViewTextBoxColumn F_Weight; private System.Windows.Forms.DataGridViewTextBoxColumn D_ID; private System.Windows.Forms.DataGridViewTextBoxColumn D_WeightBill_ID; private System.Windows.Forms.DataGridViewTextBoxColumn D_Index; @@ -1570,5 +1567,12 @@ private System.Windows.Forms.DataGridViewTextBoxColumn S_Index; private System.Windows.Forms.DataGridViewTextBoxColumn S_AbnormalItem_Name; private System.Windows.Forms.DataGridViewTextBoxColumn S_Number; + private System.Windows.Forms.DataGridViewTextBoxColumn F_ID; + private System.Windows.Forms.DataGridViewTextBoxColumn F_WeightBill_ID; + private System.Windows.Forms.DataGridViewTextBoxColumn F_Farmer_ID; + private System.Windows.Forms.DataGridViewTextBoxColumn F_Index; + private System.Windows.Forms.DataGridViewTextBoxColumn F_Farmer_Name; + private System.Windows.Forms.DataGridViewTextBoxColumn F_Number; + private System.Windows.Forms.DataGridViewTextBoxColumn F_Weight; } } \ No newline at end of file diff --git a/ButcherWeight/WeightForm.cs b/ButcherWeight/WeightForm.cs index 2cc1b08..bd37f14 100644 --- a/ButcherWeight/WeightForm.cs +++ b/ButcherWeight/WeightForm.cs @@ -62,7 +62,6 @@ namespace ButcherWeight weightGrid.AutoGenerateColumns = false; houseGird.AutoGenerateColumns = false; abnormalGrid.AutoGenerateColumns = false; - BindWeightBill(); mainIsRun = true; var syncThread = new Thread(SyncTask); syncThread.Start(); @@ -77,9 +76,18 @@ namespace ButcherWeight private void SyncTask() { + bool commingRefreshed = false; while (mainIsRun) { Thread.Sleep(2000); + if (!commingRefreshed) + { + this.Invoke(new InvokeHandler(delegate() + { + BindWeightBill(); + })); + commingRefreshed = true; + } bool changed = false; var ids = dmoList.Where(x => x.B3ID == null).Select(x => (long?)x.ID).ToList(); if (ids.Any()) @@ -200,7 +208,7 @@ namespace ButcherWeight weightGrid.DataSource = _details; weightGrid.Refresh(); - WeightValue = null; + WeightValue = 0; } private void readPiBtn_Click(object sender, EventArgs e) @@ -220,7 +228,7 @@ namespace ButcherWeight record.WeightBill_Detail_ID = target.ID; weightRecord.Add(record); weightGrid.Refresh(); - WeightValue = null; + WeightValue = 0; } private void farmerSelect_SelectedIndexChanged(object sender, EventArgs e) @@ -425,8 +433,9 @@ namespace ButcherWeight private void deleteBtn_Click(object sender, EventArgs e) { - if (Dmo.ID != 0) - WeightBillRpc.Delete(Dmo.ID); + if (Dmo.ID == 0) + throw new Exception("无效的单据"); + WeightBillRpc.Delete(Dmo.ID); if (dmoList.Any(x => x.ID == Dmo.ID)) { var idx = dmoList.FindIndex(x => x.ID == Dmo.ID); diff --git a/ButcherWeight/WeightFormWeightPart.cs b/ButcherWeight/WeightFormWeightPart.cs index 958ab22..5b3aee9 100644 --- a/ButcherWeight/WeightFormWeightPart.cs +++ b/ButcherWeight/WeightFormWeightPart.cs @@ -18,8 +18,6 @@ namespace ButcherWeight private bool _mainProcessIsRun; readonly StringBuilder _dataStrBuilder = new StringBuilder(); - private string _displayValue; - void OpenSerialPort() { if (enableCheckBox.Checked) @@ -107,7 +105,7 @@ namespace ButcherWeight str = "0"; this.Invoke(new InvokeHandler(delegate() { - _displayValue = string.Format(format, decimal.Parse(str)); + weightLabel.Text = string.Format(format, decimal.Parse(str)); })); } _dataStrBuilder.Clear();