diff --git a/ButcherFactory.BO/Base/SyncBill.cs b/ButcherFactory.BO/Base/SyncBill.cs index 71c2073..8def216 100644 --- a/ButcherFactory.BO/Base/SyncBill.cs +++ b/ButcherFactory.BO/Base/SyncBill.cs @@ -11,8 +11,15 @@ namespace ButcherFactory.BO [KeyField("ID", KeyGenType.identity)] public abstract class SyncBill { + public SyncBill() + { + CreateTime = DateTime.Now; + } + public long ID { get; set; } + public int? RowIndex { get; set; } + public int RowVersion { get; set; } [DbColumn(DbType = SqlDbType.DateTime)] diff --git a/ButcherFactory.BO/BaseInfo/ProductBatch.cs b/ButcherFactory.BO/BaseInfo/ProductBatch.cs index 5065ab6..5cdb86b 100644 --- a/ButcherFactory.BO/BaseInfo/ProductBatch.cs +++ b/ButcherFactory.BO/BaseInfo/ProductBatch.cs @@ -11,5 +11,6 @@ namespace ButcherFactory.BO [MapToTable("Butcher_ProductBatch")] public class ProductBatch : BaseInfo { + public DateTime? Date { get; set; } } } diff --git a/ButcherFactory.BO/Bill/CarcassInStore.cs b/ButcherFactory.BO/Bill/CarcassInStore.cs index ea05c11..3e3463a 100644 --- a/ButcherFactory.BO/Bill/CarcassInStore.cs +++ b/ButcherFactory.BO/Bill/CarcassInStore.cs @@ -13,11 +13,6 @@ namespace ButcherFactory.BO [DBIndexType("IDX_Butcher_CarcassInStore_Clustered", IndexType.Clustered)] public class CarcassInStore : SyncBill { - public CarcassInStore() - { - CreateTime = DateTime.Now; - } - public string BarCode { get; set; } public long? WorkUnit_ID { get; set; } diff --git a/ButcherFactory.BO/Bill/CarcassTakeOut.cs b/ButcherFactory.BO/Bill/CarcassTakeOut.cs index 8360262..60ca667 100644 --- a/ButcherFactory.BO/Bill/CarcassTakeOut.cs +++ b/ButcherFactory.BO/Bill/CarcassTakeOut.cs @@ -13,11 +13,6 @@ namespace ButcherFactory.BO [DBIndexType("IDX_Butcher_CarcassTakeOut_Clustered", IndexType.Clustered)] public class CarcassTakeOut : SyncBill { - public CarcassTakeOut() - { - CreateTime = DateTime.Now; - } - public string BarCode { get; set; } public long? WorkUnit_ID { get; set; } diff --git a/ButcherFactory.BO/LocalBL/BaseInfoBL.cs b/ButcherFactory.BO/LocalBL/BaseInfoBL.cs index 9cb423f..8168825 100644 --- a/ButcherFactory.BO/LocalBL/BaseInfoBL.cs +++ b/ButcherFactory.BO/LocalBL/BaseInfoBL.cs @@ -11,14 +11,14 @@ namespace ButcherFactory.BO.LocalBL { public static class BaseInfoBL { - public static List GetList() + public static List GetList(int? range = null) where T : BaseInfo, new() { var query = new DQueryDom(new JoinAlias(typeof(T))); query.Columns.Add(DQSelectColumn.Field("ID")); query.Columns.Add(DQSelectColumn.Field("Name")); query.OrderBy.Expressions.Add(DQOrderByExpression.Create("ID", true)); - var result = new List(); + var result = new List(); using (var session = DmoSession.New()) { using (var reader = session.ExecuteReader(query)) diff --git a/ButcherFactory.BO/LocalBL/CarcassInStoreBL.cs b/ButcherFactory.BO/LocalBL/CarcassInStoreBL.cs index 8061fa1..9091a65 100644 --- a/ButcherFactory.BO/LocalBL/CarcassInStoreBL.cs +++ b/ButcherFactory.BO/LocalBL/CarcassInStoreBL.cs @@ -71,6 +71,8 @@ namespace ButcherFactory.BO.LocalBL { var entity = CreateCarcassInStore(workUnitID, batchID, item, fromPad); entity.Goods_Name = GetGoodsName(item.Item1, session); + if (batchID.HasValue) + entity.RowIndex = GetRowIndex(session, batchID.Value); session.Insert(entity); list.Add(entity); } @@ -80,6 +82,14 @@ namespace ButcherFactory.BO.LocalBL return list; } + static int GetRowIndex(IDmoSession session, long batchID) + { + var query = new DQueryDom(new JoinAlias(typeof(CarcassInStore))); + query.Columns.Add(DQSelectColumn.Max("RowIndex")); + query.Where.Conditions.Add(DQCondition.EQ("batchID", batchID)); + return query.EExecuteScalar(session) ?? 0; + } + static CarcassInStore CreateCarcassInStore(long? workUnitID, long? batchID, Tuple goodsCode, bool fromPad) { var entity = new CarcassInStore(); diff --git a/ButcherFactory.BO/LocalBL/CarcassTakeOutBL.cs b/ButcherFactory.BO/LocalBL/CarcassTakeOutBL.cs index d207d03..585a1ec 100644 --- a/ButcherFactory.BO/LocalBL/CarcassTakeOutBL.cs +++ b/ButcherFactory.BO/LocalBL/CarcassTakeOutBL.cs @@ -29,6 +29,7 @@ namespace ButcherFactory.BO.LocalBL entity.WorkUnit_ID = workUnitID; entity.BarCode = barCode; entity.UserID = AppContext.Worker.ID; + entity.RowIndex = GetRowIndex(session); session.Insert(entity); isNew = true; } @@ -43,6 +44,14 @@ namespace ButcherFactory.BO.LocalBL } } + static int GetRowIndex(IDmoSession session) + { + var query = new DQueryDom(new JoinAlias("_main", typeof(CarcassTakeOut))); + query.Columns.Add(DQSelectColumn.Max("RowIndex")); + query.Where.Conditions.Add(DQCondition.EQ(DQExpression.Snippet("CAST([_main].[CreateTime] AS DATE)"), DQExpression.Value(DateTime.Today))); + return query.EExecuteScalar(session) ?? 0; + } + private static CarcassTakeOut GetEntityByBarCode(string barCode, IDmoSession session) { var query = new DQueryDom(new JoinAlias(typeof(CarcassTakeOut))); diff --git a/ButcherFactory.Form/ButcherFactory.Form.csproj b/ButcherFactory.Form/ButcherFactory.Form.csproj index 9f6c659..d105651 100644 --- a/ButcherFactory.Form/ButcherFactory.Form.csproj +++ b/ButcherFactory.Form/ButcherFactory.Form.csproj @@ -57,7 +57,8 @@ CarcassInStoreForm.cs - + + Form diff --git a/ButcherFactory.Form/CarcassInStore_/CarcassInStoreForm.Designer.cs b/ButcherFactory.Form/CarcassInStore_/CarcassInStoreForm.Designer.cs index 58fb720..9d4b946 100644 --- a/ButcherFactory.Form/CarcassInStore_/CarcassInStoreForm.Designer.cs +++ b/ButcherFactory.Form/CarcassInStore_/CarcassInStoreForm.Designer.cs @@ -29,17 +29,18 @@ private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CarcassInStoreForm)); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle31 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle32 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle36 = 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 dataGridViewCellStyle35 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle37 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle38 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle40 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle39 = 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 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 dataGridViewCellStyle10 = 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(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); this.splitContainer1 = new System.Windows.Forms.SplitContainer(); + this.lowWeight = new WinFormControl.UTextBoxWithPad(); this.noWeightBtn = new WinFormControl.UButton(); this.noCodeBtn = new WinFormControl.UButton(); this.closeBtn = new WinFormControl.UButton(); @@ -51,15 +52,10 @@ this.uWeightControl1 = new WinFormControl.UWeightControl(); this.uLabel1 = new WinFormControl.ULabel(); this.uLabel2 = new WinFormControl.ULabel(); + this.uLabel5 = new WinFormControl.ULabel(); this.splitContainer2 = new System.Windows.Forms.SplitContainer(); this.groupBox2 = new System.Windows.Forms.GroupBox(); this.historyDataGrid = new WinFormControl.UDataGridView(); - this.H_ID = 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.H_BeforeWeight = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.H_Discont = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.uLabel4 = new WinFormControl.ULabel(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.needSubmitGrid = new WinFormControl.UDataGridView(); @@ -69,8 +65,13 @@ this.U_Weight = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.uLabel3 = new WinFormControl.ULabel(); this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); - this.uLabel5 = new WinFormControl.ULabel(); - this.lowWeight = new WinFormControl.UTextBoxWithPad(); + 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(); + this.H_BeforeWeight = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.H_Discont = new System.Windows.Forms.DataGridViewTextBoxColumn(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); @@ -120,6 +121,15 @@ this.splitContainer1.SplitterDistance = 86; this.splitContainer1.TabIndex = 0; // + // lowWeight + // + this.lowWeight.Font = new System.Drawing.Font("宋体", 15F); + this.lowWeight.Location = new System.Drawing.Point(512, 47); + this.lowWeight.Name = "lowWeight"; + this.lowWeight.Size = new System.Drawing.Size(49, 30); + this.lowWeight.TabIndex = 13; + this.lowWeight.Type = WinFormControl.UTextBoxWithPad.TextBoxType.Number; + // // noWeightBtn // this.noWeightBtn.AsClicked = false; @@ -265,6 +275,17 @@ this.uLabel2.TabIndex = 6; this.uLabel2.Text = "生产批次:"; // + // uLabel5 + // + this.uLabel5.AutoSize = true; + this.uLabel5.BackColor = System.Drawing.Color.Transparent; + this.uLabel5.Font = new System.Drawing.Font("宋体", 15F); + this.uLabel5.Location = new System.Drawing.Point(468, 53); + this.uLabel5.Name = "uLabel5"; + this.uLabel5.Size = new System.Drawing.Size(49, 20); + this.uLabel5.TabIndex = 12; + this.uLabel5.Text = "低重"; + // // splitContainer2 // this.splitContainer2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; @@ -308,18 +329,19 @@ this.historyDataGrid.AllowUserToDeleteRows = false; this.historyDataGrid.AllowUserToResizeColumns = false; this.historyDataGrid.AllowUserToResizeRows = false; - dataGridViewCellStyle31.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); - this.historyDataGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle31; + 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; - dataGridViewCellStyle32.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle32.Font = new System.Drawing.Font("宋体", 12F); - dataGridViewCellStyle32.ForeColor = System.Drawing.Color.White; - dataGridViewCellStyle32.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.historyDataGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle32; + 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_ID, + this.H_RowIndex, this.H_BarCode, this.H_Goods_Name, this.H_Weight, @@ -331,65 +353,14 @@ this.historyDataGrid.Name = "historyDataGrid"; this.historyDataGrid.ReadOnly = true; this.historyDataGrid.RowHeadersVisible = false; - 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.historyDataGrid.RowsDefaultCellStyle = dataGridViewCellStyle36; + dataGridViewCellStyle6.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle6.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); + this.historyDataGrid.RowsDefaultCellStyle = dataGridViewCellStyle6; this.historyDataGrid.RowTemplate.Height = 23; this.historyDataGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.historyDataGrid.Size = new System.Drawing.Size(638, 230); this.historyDataGrid.TabIndex = 2; // - // H_ID - // - this.H_ID.DataPropertyName = "ID"; - this.H_ID.HeaderText = "序号"; - this.H_ID.Name = "H_ID"; - this.H_ID.ReadOnly = true; - this.H_ID.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"; - dataGridViewCellStyle33.Format = "#0.######"; - this.H_Weight.DefaultCellStyle = dataGridViewCellStyle33; - this.H_Weight.HeaderText = "入库重量"; - this.H_Weight.Name = "H_Weight"; - this.H_Weight.ReadOnly = true; - // - // H_BeforeWeight - // - this.H_BeforeWeight.DataPropertyName = "BeforeWeight"; - dataGridViewCellStyle34.Format = "#0.######"; - this.H_BeforeWeight.DefaultCellStyle = dataGridViewCellStyle34; - this.H_BeforeWeight.HeaderText = "胴体重量"; - this.H_BeforeWeight.Name = "H_BeforeWeight"; - this.H_BeforeWeight.ReadOnly = true; - // - // H_Discont - // - this.H_Discont.DataPropertyName = "Discont"; - dataGridViewCellStyle35.Format = "#0.######"; - this.H_Discont.DefaultCellStyle = dataGridViewCellStyle35; - this.H_Discont.HeaderText = "损耗"; - this.H_Discont.Name = "H_Discont"; - this.H_Discont.ReadOnly = true; - // // uLabel4 // this.uLabel4.AutoSize = true; @@ -420,15 +391,15 @@ this.needSubmitGrid.AllowUserToDeleteRows = false; this.needSubmitGrid.AllowUserToResizeColumns = false; this.needSubmitGrid.AllowUserToResizeRows = false; - dataGridViewCellStyle37.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); - this.needSubmitGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle37; + dataGridViewCellStyle7.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); + this.needSubmitGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle7; this.needSubmitGrid.BackgroundColor = System.Drawing.Color.White; this.needSubmitGrid.BorderStyle = System.Windows.Forms.BorderStyle.None; - dataGridViewCellStyle38.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle38.Font = new System.Drawing.Font("宋体", 12F); - dataGridViewCellStyle38.ForeColor = System.Drawing.Color.White; - dataGridViewCellStyle38.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.needSubmitGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle38; + dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle8.Font = new System.Drawing.Font("宋体", 12F); + dataGridViewCellStyle8.ForeColor = System.Drawing.Color.White; + dataGridViewCellStyle8.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.needSubmitGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle8; this.needSubmitGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.needSubmitGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.U_ID, @@ -441,9 +412,9 @@ this.needSubmitGrid.Name = "needSubmitGrid"; this.needSubmitGrid.ReadOnly = true; this.needSubmitGrid.RowHeadersVisible = false; - dataGridViewCellStyle40.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle40.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); - this.needSubmitGrid.RowsDefaultCellStyle = dataGridViewCellStyle40; + 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.needSubmitGrid.RowsDefaultCellStyle = dataGridViewCellStyle10; this.needSubmitGrid.RowTemplate.Height = 23; this.needSubmitGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.needSubmitGrid.Size = new System.Drawing.Size(638, 202); @@ -476,8 +447,8 @@ // U_Weight // this.U_Weight.DataPropertyName = "Weight"; - dataGridViewCellStyle39.Format = "#0.######"; - this.U_Weight.DefaultCellStyle = dataGridViewCellStyle39; + dataGridViewCellStyle9.Format = "#0.######"; + this.U_Weight.DefaultCellStyle = dataGridViewCellStyle9; this.U_Weight.HeaderText = "重量"; this.U_Weight.Name = "U_Weight"; this.U_Weight.ReadOnly = true; @@ -502,25 +473,64 @@ this.flowLayoutPanel1.Size = new System.Drawing.Size(549, 519); this.flowLayoutPanel1.TabIndex = 0; // - // uLabel5 + // H_ID // - this.uLabel5.AutoSize = true; - this.uLabel5.BackColor = System.Drawing.Color.Transparent; - this.uLabel5.Font = new System.Drawing.Font("宋体", 15F); - this.uLabel5.Location = new System.Drawing.Point(468, 53); - this.uLabel5.Name = "uLabel5"; - this.uLabel5.Size = new System.Drawing.Size(49, 20); - this.uLabel5.TabIndex = 12; - this.uLabel5.Text = "低重"; + 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; // - // lowWeight + // H_RowIndex // - this.lowWeight.Font = new System.Drawing.Font("宋体", 15F); - this.lowWeight.Location = new System.Drawing.Point(512, 47); - this.lowWeight.Name = "lowWeight"; - this.lowWeight.Size = new System.Drawing.Size(49, 30); - this.lowWeight.TabIndex = 13; - this.lowWeight.Type = WinFormControl.UTextBoxWithPad.TextBoxType.Number; + 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; + // + // H_BeforeWeight + // + this.H_BeforeWeight.DataPropertyName = "BeforeWeight"; + dataGridViewCellStyle4.Format = "#0.######"; + this.H_BeforeWeight.DefaultCellStyle = dataGridViewCellStyle4; + this.H_BeforeWeight.HeaderText = "胴体重量"; + this.H_BeforeWeight.Name = "H_BeforeWeight"; + this.H_BeforeWeight.ReadOnly = true; + // + // H_Discont + // + this.H_Discont.DataPropertyName = "Discont"; + dataGridViewCellStyle5.Format = "#0.######"; + this.H_Discont.DefaultCellStyle = dataGridViewCellStyle5; + this.H_Discont.HeaderText = "损耗"; + this.H_Discont.Name = "H_Discont"; + this.H_Discont.ReadOnly = true; // // CarcassInStoreForm // @@ -572,12 +582,6 @@ private WinFormControl.UDataGridView needSubmitGrid; private WinFormControl.UDataGridView historyDataGrid; private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1; - private System.Windows.Forms.DataGridViewTextBoxColumn H_ID; - 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 H_BeforeWeight; - private System.Windows.Forms.DataGridViewTextBoxColumn H_Discont; private System.Windows.Forms.DataGridViewTextBoxColumn U_ID; private System.Windows.Forms.DataGridViewTextBoxColumn U_BarCode; private System.Windows.Forms.DataGridViewTextBoxColumn U_Goods_Name; @@ -586,6 +590,13 @@ private WinFormControl.UButton noWeightBtn; private WinFormControl.ULabel uLabel5; private WinFormControl.UTextBoxWithPad lowWeight; + 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; + private System.Windows.Forms.DataGridViewTextBoxColumn H_BeforeWeight; + private System.Windows.Forms.DataGridViewTextBoxColumn H_Discont; } diff --git a/ButcherFactory.Form/CarcassInStore_/CarcassInStoreForm.cs b/ButcherFactory.Form/CarcassInStore_/CarcassInStoreForm.cs index 74c851f..d490c91 100644 --- a/ButcherFactory.Form/CarcassInStore_/CarcassInStoreForm.cs +++ b/ButcherFactory.Form/CarcassInStore_/CarcassInStoreForm.cs @@ -60,6 +60,7 @@ namespace ButcherFactory.CarcassInStore_ workUnitID = null; else workUnitID = (long)workUnitSelect.SelectedValue; + SaveConfig(workUnitSelect, EventArgs.Empty); }; productBatchSelect.SelectedIndexChanged += delegate { @@ -68,36 +69,24 @@ namespace ButcherFactory.CarcassInStore_ else batchID = (long)productBatchSelect.SelectedValue; }; - var lw = XmlUtil.DeserializeFromFile().Weight; - if (lw.HasValue){ - lowWeight.Text = lw.Value.ToString("#0.######"); - errorWeight=lw; - } - lowWeight.LostFocus += lowWeight_LostFocus; + lowWeight.LostFocus += SaveConfig; } - void lowWeight_LostFocus(object sender, EventArgs e) + void SaveConfig(object sender, EventArgs e) { var txt = lowWeight.Text.Trim(); if (string.IsNullOrEmpty(txt)) - { - XmlUtil.SerializerObjToFile(new LowWeight()); errorWeight = null; - } else { decimal v; if (decimal.TryParse(lowWeight.Text.Trim(), out v)) - { - XmlUtil.SerializerObjToFile(new LowWeight { Weight = v }); errorWeight = v; - } else - { - lowWeight.Focus(); - throw new Exception("低重设置错误"); - } + lowWeight.Text = string.Format("{0:#0.######}", errorWeight); } + + XmlUtil.SerializerObjToFile(new CarcassInStoreFormConfig { Weight = errorWeight, WorkUnitID = workUnitID }); } @@ -158,8 +147,14 @@ namespace ButcherFactory.CarcassInStore_ BaseInfoSyncRpc.SyncBaseInfo(); BaseInfoSyncRpc.SyncBaseInfo(); } - workUnitSelect.EBindComboBox(); - productBatchSelect.EBindComboBox(); + productBatchSelect.EBindComboBox(x => x.Date == DateTime.Today); + var config = XmlUtil.DeserializeFromFile(); + if (config.Weight.HasValue) + { + lowWeight.Text = config.Weight.Value.ToString("#0.######"); + errorWeight = config.Weight; + } + workUnitSelect.EBindComboBox(x => x.ID == config.WorkUnitID); BindGoods(); BindGrid(); diff --git a/ButcherFactory.Form/CarcassInStore_/CarcassInStoreForm.resx b/ButcherFactory.Form/CarcassInStore_/CarcassInStoreForm.resx index 58106bd..7aae463 100644 --- a/ButcherFactory.Form/CarcassInStore_/CarcassInStoreForm.resx +++ b/ButcherFactory.Form/CarcassInStore_/CarcassInStoreForm.resx @@ -145,6 +145,9 @@ True + + True + True diff --git a/ButcherFactory.Form/CarcassInStore_/LowWeight.cs b/ButcherFactory.Form/CarcassInStore_/CarcassInStoreFormConfig.cs similarity index 72% rename from ButcherFactory.Form/CarcassInStore_/LowWeight.cs rename to ButcherFactory.Form/CarcassInStore_/CarcassInStoreFormConfig.cs index 199ca64..e5bfc46 100644 --- a/ButcherFactory.Form/CarcassInStore_/LowWeight.cs +++ b/ButcherFactory.Form/CarcassInStore_/CarcassInStoreFormConfig.cs @@ -6,8 +6,10 @@ using System.Threading.Tasks; namespace ButcherFactory.CarcassInStore_ { - public class LowWeight + public class CarcassInStoreFormConfig { public decimal? Weight { get; set; } + + public long? WorkUnitID { get; set; } } } diff --git a/ButcherFactory.Form/CarcassTakeOut_/CarcassTakeOutForm.Designer.cs b/ButcherFactory.Form/CarcassTakeOut_/CarcassTakeOutForm.Designer.cs index 1f511e7..0c0f216 100644 --- a/ButcherFactory.Form/CarcassTakeOut_/CarcassTakeOutForm.Designer.cs +++ b/ButcherFactory.Form/CarcassTakeOut_/CarcassTakeOutForm.Designer.cs @@ -32,12 +32,12 @@ 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 dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = 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(); this.workUnitSelect = new System.Windows.Forms.ComboBox(); this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.closeBtn = new WinFormControl.UButton(); @@ -48,23 +48,25 @@ this.uLabel1 = new WinFormControl.ULabel(); this.groupBox2 = new System.Windows.Forms.GroupBox(); this.historyDataGrid = new WinFormControl.UDataGridView(); - this.H_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.H_BarCode = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.H_Goods_Name = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.H_BeforeWeight = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.H_Weight = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.uLabel4 = new WinFormControl.ULabel(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.readBtn = new WinFormControl.UButton(); this.deleteBtn = new WinFormControl.UButton(); this.submitBtn = new WinFormControl.UButton(); this.needSubmitGrid = new WinFormControl.UDataGridView(); + this.uLabel3 = 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.uLabel3 = new WinFormControl.ULabel(); + 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_BeforeWeight = 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(); @@ -210,6 +212,7 @@ 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; dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; dataGridViewCellStyle2.Font = new System.Drawing.Font("宋体", 12F); dataGridViewCellStyle2.ForeColor = System.Drawing.Color.White; @@ -218,6 +221,7 @@ 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, this.H_BeforeWeight, @@ -236,49 +240,6 @@ this.historyDataGrid.Size = new System.Drawing.Size(1130, 230); this.historyDataGrid.TabIndex = 2; // - // H_ID - // - this.H_ID.DataPropertyName = "ID"; - this.H_ID.HeaderText = "序号"; - this.H_ID.Name = "H_ID"; - this.H_ID.ReadOnly = true; - // - // 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_BeforeWeight - // - this.H_BeforeWeight.DataPropertyName = "BeforeWeight"; - dataGridViewCellStyle3.Format = "#0.######"; - this.H_BeforeWeight.DefaultCellStyle = dataGridViewCellStyle3; - this.H_BeforeWeight.HeaderText = "入库重量"; - this.H_BeforeWeight.Name = "H_BeforeWeight"; - this.H_BeforeWeight.ReadOnly = true; - this.H_BeforeWeight.Width = 150; - // - // H_Weight - // - this.H_Weight.DataPropertyName = "Weight"; - dataGridViewCellStyle4.Format = "#0.######"; - this.H_Weight.DefaultCellStyle = dataGridViewCellStyle4; - this.H_Weight.HeaderText = "重量"; - this.H_Weight.Name = "H_Weight"; - this.H_Weight.ReadOnly = true; - this.H_Weight.Width = 150; - // // uLabel4 // this.uLabel4.AutoSize = true; @@ -375,6 +336,7 @@ dataGridViewCellStyle6.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); this.needSubmitGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle6; this.needSubmitGrid.BackgroundColor = System.Drawing.Color.White; + this.needSubmitGrid.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; @@ -383,6 +345,7 @@ this.needSubmitGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.needSubmitGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.U_ID, + this.U_RowIndex, this.U_BarCode, this.U_Goods_Name, this.U_BeforeWeight, @@ -401,12 +364,31 @@ this.needSubmitGrid.Size = new System.Drawing.Size(1130, 159); this.needSubmitGrid.TabIndex = 1; // + // uLabel3 + // + this.uLabel3.AutoSize = true; + this.uLabel3.BackColor = System.Drawing.Color.White; + this.uLabel3.Font = new System.Drawing.Font("宋体", 13F); + this.uLabel3.Location = new System.Drawing.Point(8, 0); + this.uLabel3.Name = "uLabel3"; + this.uLabel3.Size = new System.Drawing.Size(80, 18); + this.uLabel3.TabIndex = 0; + this.uLabel3.Text = "领料明细"; + // // U_ID // this.U_ID.DataPropertyName = "ID"; - this.U_ID.HeaderText = "序号"; + 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 // @@ -442,16 +424,56 @@ this.U_Weight.ReadOnly = true; this.U_Weight.Width = 150; // - // uLabel3 + // H_ID // - this.uLabel3.AutoSize = true; - this.uLabel3.BackColor = System.Drawing.Color.White; - this.uLabel3.Font = new System.Drawing.Font("宋体", 13F); - this.uLabel3.Location = new System.Drawing.Point(8, 0); - this.uLabel3.Name = "uLabel3"; - this.uLabel3.Size = new System.Drawing.Size(80, 18); - this.uLabel3.TabIndex = 0; - this.uLabel3.Text = "领料明细"; + 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; + // + // 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_BeforeWeight + // + this.H_BeforeWeight.DataPropertyName = "BeforeWeight"; + dataGridViewCellStyle3.Format = "#0.######"; + this.H_BeforeWeight.DefaultCellStyle = dataGridViewCellStyle3; + this.H_BeforeWeight.HeaderText = "入库重量"; + this.H_BeforeWeight.Name = "H_BeforeWeight"; + this.H_BeforeWeight.ReadOnly = true; + this.H_BeforeWeight.Width = 150; + // + // H_Weight + // + this.H_Weight.DataPropertyName = "Weight"; + dataGridViewCellStyle4.Format = "#0.######"; + this.H_Weight.DefaultCellStyle = dataGridViewCellStyle4; + this.H_Weight.HeaderText = "重量"; + this.H_Weight.Name = "H_Weight"; + this.H_Weight.ReadOnly = true; + this.H_Weight.Width = 150; // // CarcassTakeOutForm // @@ -498,11 +520,13 @@ private WinFormControl.UButton deleteBtn; private WinFormControl.UButton submitBtn; 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_BeforeWeight; private System.Windows.Forms.DataGridViewTextBoxColumn H_Weight; private System.Windows.Forms.DataGridViewTextBoxColumn U_ID; + private System.Windows.Forms.DataGridViewTextBoxColumn U_RowIndex; private System.Windows.Forms.DataGridViewTextBoxColumn U_BarCode; private System.Windows.Forms.DataGridViewTextBoxColumn U_Goods_Name; private System.Windows.Forms.DataGridViewTextBoxColumn U_BeforeWeight; diff --git a/ButcherFactory.Form/CarcassTakeOut_/CarcassTakeOutForm.cs b/ButcherFactory.Form/CarcassTakeOut_/CarcassTakeOutForm.cs index a581f0d..79692fb 100644 --- a/ButcherFactory.Form/CarcassTakeOut_/CarcassTakeOutForm.cs +++ b/ButcherFactory.Form/CarcassTakeOut_/CarcassTakeOutForm.cs @@ -45,7 +45,8 @@ namespace ButcherFactory.CarcassTakeOut_ if (workUnitSelect.SelectedValue == null) workUnitID = null; else - workUnitID = (long)workUnitSelect.SelectedValue; + workUnitID = (long)workUnitSelect.SelectedValue; + XmlUtil.SerializerObjToFile(new CarcassTakeOutFormConfig { WorkUnitID = workUnitID }); }; this.FormClosing += delegate { @@ -78,7 +79,9 @@ namespace ButcherFactory.CarcassTakeOut_ BaseInfoSyncRpc.SyncGoodsByTag(ApplyClient.白条出入库); BaseInfoSyncRpc.SyncBaseInfo(); } - workUnitSelect.EBindComboBox(); + + var config = XmlUtil.DeserializeFromFile(); + workUnitSelect.EBindComboBox(x => x.ID == config.WorkUnitID); BindGrid(); })); diff --git a/ButcherFactory.Form/CarcassTakeOut_/CarcassTakeOutForm.resx b/ButcherFactory.Form/CarcassTakeOut_/CarcassTakeOutForm.resx index 8d13582..0127c58 100644 --- a/ButcherFactory.Form/CarcassTakeOut_/CarcassTakeOutForm.resx +++ b/ButcherFactory.Form/CarcassTakeOut_/CarcassTakeOutForm.resx @@ -126,6 +126,9 @@ KAgKgoKg1ZsPvpCB0hBohjQAAAAASUVORK5CYII= + + True + iVBORw0KGgoAAAANSUhEUgAAAGAAAAAwCAIAAABhdOiYAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO @@ -150,6 +153,9 @@ KAgKgoKg1ZsPvpCB0hBohjQAAAAASUVORK5CYII= + + True + True diff --git a/ButcherFactory.Form/CarcassTakeOut_/CarcassTakeOutFormConfig.cs b/ButcherFactory.Form/CarcassTakeOut_/CarcassTakeOutFormConfig.cs new file mode 100644 index 0000000..28fd93d --- /dev/null +++ b/ButcherFactory.Form/CarcassTakeOut_/CarcassTakeOutFormConfig.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ButcherFactory.CarcassTakeOut_ +{ + public class CarcassTakeOutFormConfig + { + public long? WorkUnitID { get; set; } + } +} diff --git a/ButcherFactory.Form/Utils/ControlsUtil.cs b/ButcherFactory.Form/Utils/ControlsUtil.cs index ec64918..83d4506 100644 --- a/ButcherFactory.Form/Utils/ControlsUtil.cs +++ b/ButcherFactory.Form/Utils/ControlsUtil.cs @@ -11,12 +11,28 @@ namespace ButcherFactory.Utils { public static class ControlsUtil { - public static void EBindComboBox(this ComboBox box) + public static void EBindComboBox(this ComboBox box, Func SetSelectIndex = null) where T : BaseInfo, new() { box.DisplayMember = "Name"; box.ValueMember = "ID"; - box.DataSource = BaseInfoBL.GetList(); + var list = BaseInfoBL.GetList(10); + box.DataSource = list; + if (SetSelectIndex != null) + { + var idx = list.FindIndex(x => SetSelectIndex(x)); + if (idx > 0) + box.SelectedIndex = idx; + } + box.Refresh(); + } + + public static void EBindComboBox(this ComboBox box, List source) + where T : BaseInfo, new() + { + box.DisplayMember = "Name"; + box.ValueMember = "ID"; + box.DataSource = source; box.Refresh(); } } diff --git a/ButcherFactory.Tools/App.xaml b/ButcherFactory.Tools/App.xaml new file mode 100644 index 0000000..fa8b0cd --- /dev/null +++ b/ButcherFactory.Tools/App.xaml @@ -0,0 +1,8 @@ + + + + + diff --git a/ButcherFactory.Tools/App.xaml.cs b/ButcherFactory.Tools/App.xaml.cs new file mode 100644 index 0000000..cc558e3 --- /dev/null +++ b/ButcherFactory.Tools/App.xaml.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.Linq; +using System.Windows; + +namespace ButcherFactory.Tools +{ + /// + /// App.xaml 的交互逻辑 + /// + public partial class App : Application + { + } +} diff --git a/ButcherFactory.Tools/ButcherFactory.Tools.csproj b/ButcherFactory.Tools/ButcherFactory.Tools.csproj new file mode 100644 index 0000000..29e567a --- /dev/null +++ b/ButcherFactory.Tools/ButcherFactory.Tools.csproj @@ -0,0 +1,110 @@ + + + + + Debug + AnyCPU + {788A10A5-154A-4590-9DDA-60AA22FBC42F} + WinExe + Properties + ButcherFactory.Tools + ButcherFactory.Tools + v4.5 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + false + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + false + + + + + + + + + + + 4.0 + + + + + + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + App.xaml + Code + + + MainWindow.xaml + Code + + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + ResXFileCodeGenerator + Resources.Designer.cs + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + + {b258c523-269c-4ed7-ab71-7196d5d2ef65} + ButcherFactory.BO + + + + + \ No newline at end of file diff --git a/ButcherFactory.Tools/MainWindow.xaml b/ButcherFactory.Tools/MainWindow.xaml new file mode 100644 index 0000000..e91c260 --- /dev/null +++ b/ButcherFactory.Tools/MainWindow.xaml @@ -0,0 +1,8 @@ + + +