diff --git a/ButcherFactory.BO/LocalBL/SegmentProductionBL.cs b/ButcherFactory.BO/LocalBL/SegmentProductionBL.cs index defeec4..0fcc74b 100644 --- a/ButcherFactory.BO/LocalBL/SegmentProductionBL.cs +++ b/ButcherFactory.BO/LocalBL/SegmentProductionBL.cs @@ -118,5 +118,12 @@ namespace ButcherFactory.BO.LocalBL session.Commit(); } } + + public static void Delete(long id) + { + var delete = new DQDeleteDom(typeof(SegmentProduction)); + delete.Where.Conditions.Add(DQCondition.EQ("ID", id)); + delete.EExecute(); + } } } diff --git a/ButcherFactory.Form/CarcassInStore_/CarcassInStoreForm.cs b/ButcherFactory.Form/CarcassInStore_/CarcassInStoreForm.cs index b62f22d..e5c6af7 100644 --- a/ButcherFactory.Form/CarcassInStore_/CarcassInStoreForm.cs +++ b/ButcherFactory.Form/CarcassInStore_/CarcassInStoreForm.cs @@ -134,7 +134,7 @@ namespace ButcherFactory.CarcassInStore_ BaseInfoSyncRpc.SyncBaseInfo(); BaseInfoSyncRpc.SyncBaseInfo(); } - productBatchSelect.EBindComboBox(x => x.Date == DateTime.Today, "Date"); + productBatchSelect.EBindComboBox(x => x.Date == DateTime.Today, 3, "Date"); var config = XmlUtil.DeserializeFromFile(); if (!string.IsNullOrEmpty(config.Weight)) { diff --git a/ButcherFactory.Form/CarcassTakeOut_/CarcassTakeOutForm.Designer.cs b/ButcherFactory.Form/CarcassTakeOut_/CarcassTakeOutForm.Designer.cs index b3510a1..11533a9 100644 --- a/ButcherFactory.Form/CarcassTakeOut_/CarcassTakeOutForm.Designer.cs +++ b/ButcherFactory.Form/CarcassTakeOut_/CarcassTakeOutForm.Designer.cs @@ -29,18 +29,18 @@ private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CarcassTakeOutForm)); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = 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 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 dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle25 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle26 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle29 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle27 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle28 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle30 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle31 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle32 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle33 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle34 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle36 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle35 = 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(); @@ -100,7 +100,7 @@ this.workUnitSelect.Location = new System.Drawing.Point(984, 11); this.workUnitSelect.Name = "workUnitSelect"; this.workUnitSelect.Size = new System.Drawing.Size(170, 28); - this.workUnitSelect.TabIndex = 3; + this.workUnitSelect.TabIndex = 7; // // splitContainer1 // @@ -144,7 +144,7 @@ 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; + this.productBatchSelect.TabIndex = 18; // // uLabel2 // @@ -175,7 +175,7 @@ this.noBarCode.SelfControlEnable = false; this.noBarCode.Size = new System.Drawing.Size(114, 34); this.noBarCode.SoundType = WinFormControl.SoundType.Click; - this.noBarCode.TabIndex = 14; + this.noBarCode.TabIndex = 2; this.noBarCode.Text = "无 码"; this.noBarCode.UseVisualStyleBackColor = true; this.noBarCode.WithStataHode = true; @@ -224,7 +224,7 @@ this.uScanPanel1.Location = new System.Drawing.Point(580, 9); this.uScanPanel1.Name = "uScanPanel1"; this.uScanPanel1.Size = new System.Drawing.Size(303, 32); - this.uScanPanel1.TabIndex = 2; + this.uScanPanel1.TabIndex = 3; // // netStateWatch1 // @@ -286,15 +286,15 @@ this.historyDataGrid.AllowUserToDeleteRows = false; this.historyDataGrid.AllowUserToResizeColumns = false; this.historyDataGrid.AllowUserToResizeRows = false; - dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); - this.historyDataGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; + dataGridViewCellStyle25.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); + this.historyDataGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle25; this.historyDataGrid.BackgroundColor = System.Drawing.Color.White; this.historyDataGrid.BorderStyle = System.Windows.Forms.BorderStyle.None; - 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; + dataGridViewCellStyle26.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle26.Font = new System.Drawing.Font("宋体", 12F); + dataGridViewCellStyle26.ForeColor = System.Drawing.Color.White; + dataGridViewCellStyle26.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.historyDataGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle26; this.historyDataGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.historyDataGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.H_ID, @@ -309,9 +309,9 @@ this.historyDataGrid.Name = "historyDataGrid"; this.historyDataGrid.ReadOnly = true; this.historyDataGrid.RowHeadersVisible = false; - dataGridViewCellStyle5.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle5.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); - this.historyDataGrid.RowsDefaultCellStyle = dataGridViewCellStyle5; + dataGridViewCellStyle29.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle29.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); + this.historyDataGrid.RowsDefaultCellStyle = dataGridViewCellStyle29; this.historyDataGrid.RowTemplate.Height = 23; this.historyDataGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.historyDataGrid.Size = new System.Drawing.Size(766, 198); @@ -351,8 +351,8 @@ // H_BeforeWeight // this.H_BeforeWeight.DataPropertyName = "BeforeWeight"; - dataGridViewCellStyle3.Format = "#0.######"; - this.H_BeforeWeight.DefaultCellStyle = dataGridViewCellStyle3; + dataGridViewCellStyle27.Format = "#0.######"; + this.H_BeforeWeight.DefaultCellStyle = dataGridViewCellStyle27; this.H_BeforeWeight.HeaderText = "入库重量"; this.H_BeforeWeight.Name = "H_BeforeWeight"; this.H_BeforeWeight.ReadOnly = true; @@ -361,8 +361,8 @@ // H_Weight // this.H_Weight.DataPropertyName = "Weight"; - dataGridViewCellStyle4.Format = "#0.######"; - this.H_Weight.DefaultCellStyle = dataGridViewCellStyle4; + dataGridViewCellStyle28.Format = "#0.######"; + this.H_Weight.DefaultCellStyle = dataGridViewCellStyle28; this.H_Weight.HeaderText = "重量"; this.H_Weight.Name = "H_Weight"; this.H_Weight.ReadOnly = true; @@ -419,15 +419,15 @@ this.weightGrid.AllowUserToDeleteRows = false; this.weightGrid.AllowUserToResizeColumns = false; this.weightGrid.AllowUserToResizeRows = false; - dataGridViewCellStyle6.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); - this.weightGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle6; + dataGridViewCellStyle30.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); + this.weightGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle30; this.weightGrid.BackgroundColor = System.Drawing.Color.White; this.weightGrid.BorderStyle = System.Windows.Forms.BorderStyle.None; - dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle7.Font = new System.Drawing.Font("宋体", 12F); - dataGridViewCellStyle7.ForeColor = System.Drawing.Color.White; - dataGridViewCellStyle7.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.weightGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle7; + dataGridViewCellStyle31.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle31.Font = new System.Drawing.Font("宋体", 12F); + dataGridViewCellStyle31.ForeColor = System.Drawing.Color.White; + dataGridViewCellStyle31.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.weightGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle31; this.weightGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.weightGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.W_ID, @@ -438,9 +438,9 @@ this.weightGrid.Name = "weightGrid"; this.weightGrid.ReadOnly = true; this.weightGrid.RowHeadersVisible = false; - dataGridViewCellStyle8.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle8.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); - this.weightGrid.RowsDefaultCellStyle = dataGridViewCellStyle8; + dataGridViewCellStyle32.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle32.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); + this.weightGrid.RowsDefaultCellStyle = dataGridViewCellStyle32; this.weightGrid.RowTemplate.Height = 23; this.weightGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.weightGrid.Size = new System.Drawing.Size(254, 200); @@ -467,15 +467,15 @@ this.needSubmitGrid.AllowUserToDeleteRows = false; this.needSubmitGrid.AllowUserToResizeColumns = false; this.needSubmitGrid.AllowUserToResizeRows = false; - dataGridViewCellStyle9.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); - this.needSubmitGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle9; + dataGridViewCellStyle33.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); + this.needSubmitGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle33; this.needSubmitGrid.BackgroundColor = System.Drawing.Color.White; this.needSubmitGrid.BorderStyle = System.Windows.Forms.BorderStyle.None; - dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle10.Font = new System.Drawing.Font("宋体", 12F); - dataGridViewCellStyle10.ForeColor = System.Drawing.Color.White; - dataGridViewCellStyle10.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.needSubmitGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle10; + dataGridViewCellStyle34.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle34.Font = new System.Drawing.Font("宋体", 12F); + dataGridViewCellStyle34.ForeColor = System.Drawing.Color.White; + dataGridViewCellStyle34.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.needSubmitGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle34; this.needSubmitGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.needSubmitGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.U_ID, @@ -490,9 +490,9 @@ this.needSubmitGrid.Name = "needSubmitGrid"; this.needSubmitGrid.ReadOnly = true; this.needSubmitGrid.RowHeadersVisible = false; - dataGridViewCellStyle12.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle12.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); - this.needSubmitGrid.RowsDefaultCellStyle = dataGridViewCellStyle12; + dataGridViewCellStyle36.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle36.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); + this.needSubmitGrid.RowsDefaultCellStyle = dataGridViewCellStyle36; this.needSubmitGrid.RowTemplate.Height = 23; this.needSubmitGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.needSubmitGrid.Size = new System.Drawing.Size(508, 200); @@ -532,8 +532,8 @@ // U_BeforeWeight // this.U_BeforeWeight.DataPropertyName = "BeforeWeight"; - dataGridViewCellStyle11.Format = "#0.######"; - this.U_BeforeWeight.DefaultCellStyle = dataGridViewCellStyle11; + dataGridViewCellStyle35.Format = "#0.######"; + this.U_BeforeWeight.DefaultCellStyle = dataGridViewCellStyle35; this.U_BeforeWeight.HeaderText = "入库重量"; this.U_BeforeWeight.Name = "U_BeforeWeight"; this.U_BeforeWeight.ReadOnly = true; diff --git a/ButcherFactory.Form/CarcassTakeOut_/CarcassTakeOutForm.cs b/ButcherFactory.Form/CarcassTakeOut_/CarcassTakeOutForm.cs index eba0b40..8c1e01c 100644 --- a/ButcherFactory.Form/CarcassTakeOut_/CarcassTakeOutForm.cs +++ b/ButcherFactory.Form/CarcassTakeOut_/CarcassTakeOutForm.cs @@ -90,7 +90,7 @@ namespace ButcherFactory.CarcassTakeOut_ BaseInfoSyncRpc.SyncBaseInfo(); } - productBatchSelect.EBindComboBox(x => x.Date == DateTime.Today, "Date"); + productBatchSelect.EBindComboBox(x => x.Date == DateTime.Today, 3, "Date"); var config = XmlUtil.DeserializeFromFile(); workUnitSelect.EBindComboBox(x => x.ID == config.WorkUnitID); diff --git a/ButcherFactory.Form/SegmentProduction_/SegmentProductionForm.Designer.cs b/ButcherFactory.Form/SegmentProduction_/SegmentProductionForm.Designer.cs index 79d71c1..7526c1b 100644 --- a/ButcherFactory.Form/SegmentProduction_/SegmentProductionForm.Designer.cs +++ b/ButcherFactory.Form/SegmentProduction_/SegmentProductionForm.Designer.cs @@ -32,13 +32,13 @@ 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(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.barPrintCheck = new System.Windows.Forms.CheckBox(); this.closeBtn = new WinFormControl.UButton(); @@ -55,10 +55,6 @@ 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(); @@ -74,6 +70,11 @@ this.endBtn = new WinFormControl.UButton(); this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); this.startBtn = new WinFormControl.UButton(); + this.H_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); + 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(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); @@ -351,6 +352,7 @@ this.historyDataGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2; this.historyDataGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.historyDataGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.H_ID, this.H_RowIndex, this.H_BarCode, this.H_Goods_Name, @@ -369,39 +371,6 @@ this.historyDataGrid.Size = new System.Drawing.Size(523, 308); this.historyDataGrid.TabIndex = 2; // - // H_RowIndex - // - this.H_RowIndex.DataPropertyName = "RowIndex"; - this.H_RowIndex.HeaderText = "序号"; - this.H_RowIndex.Name = "H_RowIndex"; - this.H_RowIndex.ReadOnly = true; - this.H_RowIndex.Width = 80; - // - // H_BarCode - // - this.H_BarCode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.H_BarCode.DataPropertyName = "BarCode"; - this.H_BarCode.HeaderText = "条码"; - this.H_BarCode.Name = "H_BarCode"; - this.H_BarCode.ReadOnly = true; - // - // H_Goods_Name - // - this.H_Goods_Name.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.H_Goods_Name.DataPropertyName = "Goods_Name"; - this.H_Goods_Name.HeaderText = "产品"; - this.H_Goods_Name.Name = "H_Goods_Name"; - this.H_Goods_Name.ReadOnly = true; - // - // H_Weight - // - this.H_Weight.DataPropertyName = "Weight"; - dataGridViewCellStyle3.Format = "#0.######"; - this.H_Weight.DefaultCellStyle = dataGridViewCellStyle3; - this.H_Weight.HeaderText = "重量"; - this.H_Weight.Name = "H_Weight"; - this.H_Weight.ReadOnly = true; - // // uLabel3 // this.uLabel3.AutoSize = true; @@ -645,6 +614,47 @@ this.startBtn.WithStataHode = false; this.startBtn.Click += new System.EventHandler(this.startBtn_Click); // + // H_ID + // + this.H_ID.DataPropertyName = "ID"; + this.H_ID.HeaderText = "ID"; + this.H_ID.Name = "H_ID"; + this.H_ID.ReadOnly = true; + this.H_ID.Visible = false; + // + // H_RowIndex + // + this.H_RowIndex.DataPropertyName = "RowIndex"; + this.H_RowIndex.HeaderText = "序号"; + this.H_RowIndex.Name = "H_RowIndex"; + this.H_RowIndex.ReadOnly = true; + this.H_RowIndex.Width = 80; + // + // H_BarCode + // + this.H_BarCode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.H_BarCode.DataPropertyName = "BarCode"; + this.H_BarCode.HeaderText = "条码"; + this.H_BarCode.Name = "H_BarCode"; + this.H_BarCode.ReadOnly = true; + // + // H_Goods_Name + // + this.H_Goods_Name.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.H_Goods_Name.DataPropertyName = "Goods_Name"; + this.H_Goods_Name.HeaderText = "产品"; + this.H_Goods_Name.Name = "H_Goods_Name"; + this.H_Goods_Name.ReadOnly = true; + // + // H_Weight + // + this.H_Weight.DataPropertyName = "Weight"; + dataGridViewCellStyle3.Format = "#0.######"; + this.H_Weight.DefaultCellStyle = dataGridViewCellStyle3; + this.H_Weight.HeaderText = "重量"; + this.H_Weight.Name = "H_Weight"; + this.H_Weight.ReadOnly = true; + // // SegmentProductionForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); @@ -701,14 +711,15 @@ private WinFormControl.UButton submitBtn; private WinFormControl.UButton deleteBtn; private WinFormControl.UButton rePrintBtn; - private System.Windows.Forms.DataGridViewTextBoxColumn H_RowIndex; - private System.Windows.Forms.DataGridViewTextBoxColumn H_BarCode; - private System.Windows.Forms.DataGridViewTextBoxColumn H_Goods_Name; - private System.Windows.Forms.DataGridViewTextBoxColumn H_Weight; private System.Windows.Forms.DataGridViewTextBoxColumn T_Item; private System.Windows.Forms.DataGridViewTextBoxColumn T_Need; private System.Windows.Forms.DataGridViewTextBoxColumn T_Done; private System.Windows.Forms.DataGridViewTextBoxColumn T_Last; private WinFormControl.UButton trunOutBtn; + private System.Windows.Forms.DataGridViewTextBoxColumn H_ID; + private System.Windows.Forms.DataGridViewTextBoxColumn H_RowIndex; + private System.Windows.Forms.DataGridViewTextBoxColumn H_BarCode; + private System.Windows.Forms.DataGridViewTextBoxColumn H_Goods_Name; + private System.Windows.Forms.DataGridViewTextBoxColumn H_Weight; } } \ No newline at end of file diff --git a/ButcherFactory.Form/SegmentProduction_/SegmentProductionForm.cs b/ButcherFactory.Form/SegmentProduction_/SegmentProductionForm.cs index 56afd11..1f9e75b 100644 --- a/ButcherFactory.Form/SegmentProduction_/SegmentProductionForm.cs +++ b/ButcherFactory.Form/SegmentProduction_/SegmentProductionForm.cs @@ -98,7 +98,7 @@ namespace ButcherFactory.SegmentProduction_ BaseInfoSyncRpc.SyncBaseInfo(); BaseInfoSyncRpc.SyncBaseInfo(); } - productBatchSelect.EBindComboBox(x => x.Date == DateTime.Today, "Date"); + productBatchSelect.EBindComboBox(x => x.Date == DateTime.Today, 3, "Date"); var config = XmlUtil.DeserializeFromFile(); workUnitSelect.EBindComboBox(x => x.ID == config.WorkUnitID); @@ -165,9 +165,7 @@ namespace ButcherFactory.SegmentProduction_ { unSubmitList = SegmentProductionBL.GetListByState(false); historyList = SegmentProductionBL.GetListByState(true); - var uCopy = unSubmitList.ToList(); - uCopy.Reverse(); - foreach (var item in uCopy) + foreach (var item in unSubmitList) historyList.Insert(0, item); historyDataGrid.DataSource = historyList; @@ -274,7 +272,19 @@ namespace ButcherFactory.SegmentProduction_ private void deleteBtn_Click(object sender, EventArgs e) { - + if (historyDataGrid.CurrentRow == null) + throw new Exception("请先选中要删除的记录"); + var id = (long)historyDataGrid.CurrentRow.Cells[0].Value; + var first = unSubmitList.FirstOrDefault(x => x.ID == id && x.GroupID == null); + if (first == null) + throw new Exception("已结束,无法删除"); + if (MessageBox.Show(string.Format("确认删除{0} {1}的记录?", first.RowIndex, first.Goods_Name), "删除确认", MessageBoxButtons.OKCancel) == DialogResult.OK) + { + SegmentProductionBL.Delete(id); + unSubmitList.Remove(first); + historyList.Remove(first); + historyDataGrid.Refresh(); + } } private void submitBtn_Click(object sender, EventArgs e) diff --git a/ButcherFactory.Form/SegmentProduction_/SegmentProductionForm.resx b/ButcherFactory.Form/SegmentProduction_/SegmentProductionForm.resx index fd9315b..dd31395 100644 --- a/ButcherFactory.Form/SegmentProduction_/SegmentProductionForm.resx +++ b/ButcherFactory.Form/SegmentProduction_/SegmentProductionForm.resx @@ -150,6 +150,9 @@ KAgKgoKg1ZsPvpCB0hBohjQAAAAASUVORK5CYII= + + True + True diff --git a/ButcherFactory.Form/Utils/ControlsUtil.cs b/ButcherFactory.Form/Utils/ControlsUtil.cs index bd60bfa..3c1859a 100644 --- a/ButcherFactory.Form/Utils/ControlsUtil.cs +++ b/ButcherFactory.Form/Utils/ControlsUtil.cs @@ -11,12 +11,13 @@ namespace ButcherFactory.Utils { public static class ControlsUtil { - public static void EBindComboBox(this ComboBox box, Func SetSelectIndex = null, params string[] extendFields) + public static void EBindComboBox(this ComboBox box, Func SetSelectIndex = null, int top = 10, params string[] extendFields) where T : BaseInfo, new() { box.DisplayMember = "Name"; box.ValueMember = "ID"; - var list = BaseInfoBL.GetList(extendFields: extendFields); + + var list = BaseInfoBL.GetList(top, extendFields: extendFields); box.DataSource = list; if (SetSelectIndex != null) {