diff --git a/B3ButcherManageClient.sln b/B3ButcherManageClient.sln index 4ea8595..10f1301 100644 --- a/B3ButcherManageClient.sln +++ b/B3ButcherManageClient.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.40629.0 +# Visual Studio 14 +VisualStudioVersion = 14.0.25420.1 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BO", "BO\BO.csproj", "{8968F14A-C7C7-4751-96CE-B114FBFD65EF}" EndProject @@ -25,6 +25,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CreateUpdateXmlFile", "Crea EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OrderConfirm", "OrderConfirm\OrderConfirm.csproj", "{D4723253-E102-40C7-819F-8052C5BE241D}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CarcassStateWeight", "CarcassStateWeight\CarcassStateWeight.csproj", "{51C38871-00FE-4F18-BD49-D6A9124A844C}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -73,6 +75,10 @@ Global {D4723253-E102-40C7-819F-8052C5BE241D}.Debug|Any CPU.Build.0 = Debug|Any CPU {D4723253-E102-40C7-819F-8052C5BE241D}.Release|Any CPU.ActiveCfg = Release|Any CPU {D4723253-E102-40C7-819F-8052C5BE241D}.Release|Any CPU.Build.0 = Release|Any CPU + {51C38871-00FE-4F18-BD49-D6A9124A844C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {51C38871-00FE-4F18-BD49-D6A9124A844C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {51C38871-00FE-4F18-BD49-D6A9124A844C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {51C38871-00FE-4F18-BD49-D6A9124A844C}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/BO/BO.csproj b/BO/BO.csproj index 217555b..59b91b8 100644 --- a/BO/BO.csproj +++ b/BO/BO.csproj @@ -30,6 +30,10 @@ 4 + + False + ..\..\..\tsref\Debug\B3ClientService.dll + False D:\BwpB3Project\tsref\Debug\Forks.EnterpriseServices.dll @@ -55,6 +59,7 @@ + @@ -76,6 +81,7 @@ + @@ -91,7 +97,9 @@ - + + + + \ No newline at end of file diff --git a/CarcassStateWeight/CarcassStateWeightForm.Designer.cs b/CarcassStateWeight/CarcassStateWeightForm.Designer.cs new file mode 100644 index 0000000..cf2254f --- /dev/null +++ b/CarcassStateWeight/CarcassStateWeightForm.Designer.cs @@ -0,0 +1,585 @@ +namespace CarcassStateWeight +{ + partial class CarcassStateWeightForm + { + /// + /// 必需的设计器变量。 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 清理所有正在使用的资源。 + /// + /// 如果应释放托管资源,为 true;否则为 false。 + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows 窗体设计器生成的代码 + + /// + /// 设计器支持所需的方法 - 不要修改 + /// 使用代码编辑器修改此方法的内容。 + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + this.enableWeight = new System.Windows.Forms.CheckBox(); + this.panel1 = new System.Windows.Forms.Panel(); + this.lblChengZhong = new System.Windows.Forms.Label(); + this.splitContainer1 = new System.Windows.Forms.SplitContainer(); + this.textBox1 = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.commitBtn = new System.Windows.Forms.Button(); + this.syncBtn = new System.Windows.Forms.Button(); + this.label1 = new System.Windows.Forms.Label(); + this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); + this.dataGridViewCode = new System.Windows.Forms.DataGridView(); + this.Product_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.State2Weight = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.State3Weight = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.State4Weight = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.State5Weight = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.CurrentState = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.CurrentWeight = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.Time = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.cb_check = new System.Windows.Forms.DataGridViewCheckBoxColumn(); + this.dataGridViewSync = new System.Windows.Forms.DataGridView(); + this.D_GradeAndWeight_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.timer1 = new System.Windows.Forms.Timer(this.components); + this.GradeAndWeight_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.Code = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.Product_Name = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.Nubmber = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.State1Weight = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.carcassStateWeightBindingSource = new System.Windows.Forms.BindingSource(this.components); + this.D_Code = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.D_Product_Name = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.D_Nubmber = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.D_State1Weight = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.D_State2Weight = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.D_State3Weight = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.D_Product_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.D_State4Weight = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.D_State5Weight = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.D_CurrentState = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.D_CurrentWeight = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.D_Time = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.carcassStateWeightBindingSource1 = new System.Windows.Forms.BindingSource(this.components); + this.butcherTimeInput = new BWP.WinFormControl.UDatePicker(); + this.uTabControl1 = new BWP.WinFormControl.UTabControl(); + this.tableLayoutPanel1.SuspendLayout(); + this.panel1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); + this.splitContainer1.Panel1.SuspendLayout(); + this.splitContainer1.Panel2.SuspendLayout(); + this.splitContainer1.SuspendLayout(); + this.tableLayoutPanel2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridViewCode)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridViewSync)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.carcassStateWeightBindingSource)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.carcassStateWeightBindingSource1)).BeginInit(); + this.SuspendLayout(); + // + // tableLayoutPanel1 + // + this.tableLayoutPanel1.ColumnCount = 1; + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.tableLayoutPanel1.Controls.Add(this.enableWeight, 0, 1); + this.tableLayoutPanel1.Controls.Add(this.panel1, 0, 0); + this.tableLayoutPanel1.Controls.Add(this.splitContainer1, 0, 2); + this.tableLayoutPanel1.Location = new System.Drawing.Point(3, 1); + this.tableLayoutPanel1.Name = "tableLayoutPanel1"; + this.tableLayoutPanel1.RowCount = 3; + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 78.83212F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 29F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 559F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + this.tableLayoutPanel1.Size = new System.Drawing.Size(1260, 653); + this.tableLayoutPanel1.TabIndex = 0; + // + // enableWeight + // + this.enableWeight.AutoCheck = false; + this.enableWeight.AutoSize = true; + this.enableWeight.Font = new System.Drawing.Font("宋体", 15F); + this.enableWeight.Location = new System.Drawing.Point(3, 68); + this.enableWeight.Name = "enableWeight"; + this.enableWeight.Size = new System.Drawing.Size(108, 23); + this.enableWeight.TabIndex = 32; + this.enableWeight.Text = "启用称重"; + this.enableWeight.UseVisualStyleBackColor = true; + // + // panel1 + // + this.panel1.BackColor = System.Drawing.Color.Black; + this.panel1.Controls.Add(this.lblChengZhong); + this.panel1.Location = new System.Drawing.Point(3, 3); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(195, 58); + this.panel1.TabIndex = 29; + // + // lblChengZhong + // + this.lblChengZhong.AutoSize = true; + this.lblChengZhong.Font = new System.Drawing.Font("宋体", 30F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.lblChengZhong.ForeColor = System.Drawing.Color.Red; + this.lblChengZhong.Location = new System.Drawing.Point(15, 18); + this.lblChengZhong.Name = "lblChengZhong"; + this.lblChengZhong.Size = new System.Drawing.Size(97, 40); + this.lblChengZhong.TabIndex = 0; + this.lblChengZhong.Text = "0.00"; + // + // splitContainer1 + // + this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer1.Location = new System.Drawing.Point(3, 97); + this.splitContainer1.Name = "splitContainer1"; + this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal; + // + // splitContainer1.Panel1 + // + this.splitContainer1.Panel1.Controls.Add(this.textBox1); + this.splitContainer1.Panel1.Controls.Add(this.butcherTimeInput); + this.splitContainer1.Panel1.Controls.Add(this.label2); + this.splitContainer1.Panel1.Controls.Add(this.commitBtn); + this.splitContainer1.Panel1.Controls.Add(this.syncBtn); + this.splitContainer1.Panel1.Controls.Add(this.label1); + // + // splitContainer1.Panel2 + // + this.splitContainer1.Panel2.Controls.Add(this.tableLayoutPanel2); + this.splitContainer1.Size = new System.Drawing.Size(1254, 553); + this.splitContainer1.SplitterDistance = 51; + this.splitContainer1.TabIndex = 33; + // + // textBox1 + // + this.textBox1.Location = new System.Drawing.Point(914, 15); + this.textBox1.Name = "textBox1"; + this.textBox1.Size = new System.Drawing.Size(150, 21); + this.textBox1.TabIndex = 11; + this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged); + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Font = new System.Drawing.Font("宋体", 15F); + this.label2.Location = new System.Drawing.Point(2, 15); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(69, 20); + this.label2.TabIndex = 8; + this.label2.Text = "日期:"; + // + // commitBtn + // + this.commitBtn.Font = new System.Drawing.Font("宋体", 15F); + this.commitBtn.Location = new System.Drawing.Point(1102, 3); + this.commitBtn.Name = "commitBtn"; + this.commitBtn.Size = new System.Drawing.Size(100, 40); + this.commitBtn.TabIndex = 7; + this.commitBtn.Text = "提交"; + this.commitBtn.UseVisualStyleBackColor = true; + this.commitBtn.Click += new System.EventHandler(this.commitBtn_Click); + // + // syncBtn + // + this.syncBtn.Font = new System.Drawing.Font("宋体", 15F); + this.syncBtn.Location = new System.Drawing.Point(299, 3); + this.syncBtn.Name = "syncBtn"; + this.syncBtn.Size = new System.Drawing.Size(100, 40); + this.syncBtn.TabIndex = 5; + this.syncBtn.Text = "同步数据"; + this.syncBtn.UseVisualStyleBackColor = true; + this.syncBtn.Click += new System.EventHandler(this.syncBtn_Click); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Font = new System.Drawing.Font("宋体", 15F); + this.label1.Location = new System.Drawing.Point(809, 15); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(89, 20); + this.label1.TabIndex = 4; + this.label1.Text = "扫码区:"; + // + // tableLayoutPanel2 + // + this.tableLayoutPanel2.ColumnCount = 3; + this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 68.31956F)); + this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 31.68044F)); + this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 506F)); + this.tableLayoutPanel2.Controls.Add(this.dataGridViewCode, 2, 0); + this.tableLayoutPanel2.Controls.Add(this.dataGridViewSync, 0, 0); + this.tableLayoutPanel2.Controls.Add(this.uTabControl1, 1, 0); + this.tableLayoutPanel2.Location = new System.Drawing.Point(6, 3); + this.tableLayoutPanel2.Name = "tableLayoutPanel2"; + this.tableLayoutPanel2.RowCount = 1; + this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.tableLayoutPanel2.Size = new System.Drawing.Size(1237, 484); + this.tableLayoutPanel2.TabIndex = 0; + // + // dataGridViewCode + // + this.dataGridViewCode.AllowUserToAddRows = false; + this.dataGridViewCode.AllowUserToDeleteRows = false; + this.dataGridViewCode.AutoGenerateColumns = false; + this.dataGridViewCode.BackgroundColor = System.Drawing.SystemColors.Control; + this.dataGridViewCode.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dataGridViewCode.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.GradeAndWeight_ID, + this.Code, + this.Product_Name, + this.Nubmber, + this.State1Weight, + this.Product_ID, + this.State2Weight, + this.State3Weight, + this.State4Weight, + this.State5Weight, + this.CurrentState, + this.CurrentWeight, + this.Time, + this.cb_check}); + this.dataGridViewCode.DataSource = this.carcassStateWeightBindingSource; + this.dataGridViewCode.Dock = System.Windows.Forms.DockStyle.Fill; + this.dataGridViewCode.Location = new System.Drawing.Point(733, 3); + this.dataGridViewCode.Name = "dataGridViewCode"; + this.dataGridViewCode.RowTemplate.Height = 23; + this.dataGridViewCode.Size = new System.Drawing.Size(501, 478); + this.dataGridViewCode.TabIndex = 2; + this.dataGridViewCode.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridViewCode_CellContentClick); + // + // Product_ID + // + this.Product_ID.DataPropertyName = "Product_ID"; + this.Product_ID.HeaderText = "Product_ID"; + this.Product_ID.Name = "Product_ID"; + this.Product_ID.Visible = false; + // + // State2Weight + // + this.State2Weight.DataPropertyName = "State2Weight"; + this.State2Weight.HeaderText = "State2Weight"; + this.State2Weight.Name = "State2Weight"; + this.State2Weight.Visible = false; + // + // State3Weight + // + this.State3Weight.DataPropertyName = "State3Weight"; + this.State3Weight.HeaderText = "State3Weight"; + this.State3Weight.Name = "State3Weight"; + this.State3Weight.Visible = false; + // + // State4Weight + // + this.State4Weight.DataPropertyName = "State4Weight"; + this.State4Weight.HeaderText = "State4Weight"; + this.State4Weight.Name = "State4Weight"; + this.State4Weight.Visible = false; + // + // State5Weight + // + this.State5Weight.DataPropertyName = "State5Weight"; + this.State5Weight.HeaderText = "State5Weight"; + this.State5Weight.Name = "State5Weight"; + this.State5Weight.Visible = false; + // + // CurrentState + // + this.CurrentState.DataPropertyName = "CurrentState"; + this.CurrentState.HeaderText = "CurrentState"; + this.CurrentState.Name = "CurrentState"; + this.CurrentState.Visible = false; + // + // CurrentWeight + // + this.CurrentWeight.DataPropertyName = "CurrentWeight"; + this.CurrentWeight.HeaderText = "CurrentWeight"; + this.CurrentWeight.Name = "CurrentWeight"; + this.CurrentWeight.Visible = false; + // + // Time + // + this.Time.DataPropertyName = "Time"; + this.Time.HeaderText = "Time"; + this.Time.Name = "Time"; + this.Time.Visible = false; + // + // cb_check + // + this.cb_check.HeaderText = "选中"; + this.cb_check.Name = "cb_check"; + this.cb_check.Width = 50; + // + // dataGridViewSync + // + this.dataGridViewSync.AllowUserToAddRows = false; + this.dataGridViewSync.AllowUserToDeleteRows = false; + this.dataGridViewSync.AutoGenerateColumns = false; + this.dataGridViewSync.BackgroundColor = System.Drawing.SystemColors.Control; + this.dataGridViewSync.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dataGridViewSync.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.D_GradeAndWeight_ID, + this.D_Code, + this.D_Product_Name, + this.D_Nubmber, + this.D_State1Weight, + this.D_State2Weight, + this.D_State3Weight, + this.D_Product_ID, + this.D_State4Weight, + this.D_State5Weight, + this.D_CurrentState, + this.D_CurrentWeight, + this.D_Time}); + this.dataGridViewSync.DataSource = this.carcassStateWeightBindingSource1; + this.dataGridViewSync.Dock = System.Windows.Forms.DockStyle.Fill; + this.dataGridViewSync.Location = new System.Drawing.Point(3, 3); + this.dataGridViewSync.Name = "dataGridViewSync"; + this.dataGridViewSync.RowTemplate.Height = 23; + this.dataGridViewSync.Size = new System.Drawing.Size(493, 478); + this.dataGridViewSync.TabIndex = 1; + this.dataGridViewSync.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridViewSync_CellContentClick); + // + // D_GradeAndWeight_ID + // + this.D_GradeAndWeight_ID.DataPropertyName = "GradeAndWeight_ID"; + this.D_GradeAndWeight_ID.HeaderText = "顺序"; + this.D_GradeAndWeight_ID.Name = "D_GradeAndWeight_ID"; + this.D_GradeAndWeight_ID.Width = 60; + // + // GradeAndWeight_ID + // + this.GradeAndWeight_ID.DataPropertyName = "GradeAndWeight_ID"; + this.GradeAndWeight_ID.HeaderText = "序号"; + this.GradeAndWeight_ID.Name = "GradeAndWeight_ID"; + this.GradeAndWeight_ID.Width = 65; + // + // Code + // + this.Code.DataPropertyName = "Code"; + this.Code.HeaderText = "条码"; + this.Code.Name = "Code"; + this.Code.Width = 65; + // + // Product_Name + // + this.Product_Name.DataPropertyName = "Product_Name"; + this.Product_Name.HeaderText = "产品名称"; + this.Product_Name.Name = "Product_Name"; + // + // Nubmber + // + this.Nubmber.DataPropertyName = "Nubmber"; + this.Nubmber.HeaderText = "数量"; + this.Nubmber.Name = "Nubmber"; + this.Nubmber.Width = 65; + // + // State1Weight + // + this.State1Weight.DataPropertyName = "State1Weight"; + this.State1Weight.HeaderText = "胴体重量"; + this.State1Weight.Name = "State1Weight"; + // + // carcassStateWeightBindingSource + // + this.carcassStateWeightBindingSource.DataSource = typeof(BO.BO.Bill.CarcassStateWeight); + // + // D_Code + // + this.D_Code.DataPropertyName = "Code"; + this.D_Code.HeaderText = "条码"; + this.D_Code.Name = "D_Code"; + this.D_Code.Width = 60; + // + // D_Product_Name + // + this.D_Product_Name.DataPropertyName = "Product_Name"; + this.D_Product_Name.HeaderText = "产品名称"; + this.D_Product_Name.Name = "D_Product_Name"; + // + // D_Nubmber + // + this.D_Nubmber.DataPropertyName = "Nubmber"; + this.D_Nubmber.HeaderText = "数量"; + this.D_Nubmber.Name = "D_Nubmber"; + this.D_Nubmber.Width = 60; + // + // D_State1Weight + // + this.D_State1Weight.DataPropertyName = "State1Weight"; + this.D_State1Weight.HeaderText = "胴体重量"; + this.D_State1Weight.Name = "D_State1Weight"; + // + // D_State2Weight + // + this.D_State2Weight.DataPropertyName = "State2Weight"; + this.D_State2Weight.HeaderText = "入库重量"; + this.D_State2Weight.Name = "D_State2Weight"; + // + // D_State3Weight + // + this.D_State3Weight.DataPropertyName = "State3Weight"; + this.D_State3Weight.HeaderText = "State3Weight"; + this.D_State3Weight.Name = "D_State3Weight"; + this.D_State3Weight.Visible = false; + // + // D_Product_ID + // + this.D_Product_ID.DataPropertyName = "Product_ID"; + this.D_Product_ID.HeaderText = "Product_ID"; + this.D_Product_ID.Name = "D_Product_ID"; + this.D_Product_ID.Visible = false; + // + // D_State4Weight + // + this.D_State4Weight.DataPropertyName = "State4Weight"; + this.D_State4Weight.HeaderText = "State4Weight"; + this.D_State4Weight.Name = "D_State4Weight"; + this.D_State4Weight.Visible = false; + // + // D_State5Weight + // + this.D_State5Weight.DataPropertyName = "State5Weight"; + this.D_State5Weight.HeaderText = "State5Weight"; + this.D_State5Weight.Name = "D_State5Weight"; + this.D_State5Weight.Visible = false; + // + // D_CurrentState + // + this.D_CurrentState.DataPropertyName = "CurrentState"; + this.D_CurrentState.HeaderText = "CurrentState"; + this.D_CurrentState.Name = "D_CurrentState"; + this.D_CurrentState.Visible = false; + // + // D_CurrentWeight + // + this.D_CurrentWeight.DataPropertyName = "CurrentWeight"; + this.D_CurrentWeight.HeaderText = "CurrentWeight"; + this.D_CurrentWeight.Name = "D_CurrentWeight"; + this.D_CurrentWeight.Visible = false; + // + // D_Time + // + this.D_Time.DataPropertyName = "Time"; + this.D_Time.HeaderText = "Time"; + this.D_Time.Name = "D_Time"; + this.D_Time.Visible = false; + // + // carcassStateWeightBindingSource1 + // + this.carcassStateWeightBindingSource1.DataSource = typeof(BO.BO.Bill.CarcassStateWeight); + // + // butcherTimeInput + // + this.butcherTimeInput.BackColor = System.Drawing.Color.White; + this.butcherTimeInput.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.butcherTimeInput.Date = new System.DateTime(2017, 10, 21, 0, 0, 0, 0); + this.butcherTimeInput.Font = new System.Drawing.Font("宋体", 15F); + this.butcherTimeInput.Location = new System.Drawing.Point(93, 10); + this.butcherTimeInput.Name = "butcherTimeInput"; + this.butcherTimeInput.Size = new System.Drawing.Size(133, 30); + this.butcherTimeInput.TabIndex = 10; + this.butcherTimeInput.Text = "2017/10/21"; + this.butcherTimeInput.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.butcherTimeInput.Type = BWP.WinFormControl.DateTimeType.Date; + // + // uTabControl1 + // + this.uTabControl1.Dock = System.Windows.Forms.DockStyle.Fill; + this.uTabControl1.FromRightFlow = false; + this.uTabControl1.Location = new System.Drawing.Point(502, 3); + this.uTabControl1.Name = "uTabControl1"; + this.uTabControl1.SelectedIndex = 0; + this.uTabControl1.Size = new System.Drawing.Size(225, 478); + this.uTabControl1.SizeMode = System.Windows.Forms.TabSizeMode.Fixed; + this.uTabControl1.TabIndex = 3; + // + // CarcassStateWeightForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(1275, 666); + this.Controls.Add(this.tableLayoutPanel1); + this.Name = "CarcassStateWeightForm"; + this.Text = "胴体称重"; + this.Load += new System.EventHandler(this.CarcassStateWeightForm_Load); + this.tableLayoutPanel1.ResumeLayout(false); + this.tableLayoutPanel1.PerformLayout(); + this.panel1.ResumeLayout(false); + this.panel1.PerformLayout(); + this.splitContainer1.Panel1.ResumeLayout(false); + this.splitContainer1.Panel1.PerformLayout(); + this.splitContainer1.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); + this.splitContainer1.ResumeLayout(false); + this.tableLayoutPanel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.dataGridViewCode)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridViewSync)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.carcassStateWeightBindingSource)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.carcassStateWeightBindingSource1)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.Label lblChengZhong; + private System.Windows.Forms.CheckBox enableWeight; + private System.Windows.Forms.SplitContainer splitContainer1; + private System.Windows.Forms.Timer timer1; + private System.Windows.Forms.Button syncBtn; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Button commitBtn; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; + private System.Windows.Forms.DataGridView dataGridViewCode; + private System.Windows.Forms.DataGridView dataGridViewSync; + private BWP.WinFormControl.UDatePicker butcherTimeInput; + private BWP.WinFormControl.UTabControl uTabControl1; + private System.Windows.Forms.TextBox textBox1; + private System.Windows.Forms.BindingSource carcassStateWeightBindingSource; + private System.Windows.Forms.BindingSource carcassStateWeightBindingSource1; + private System.Windows.Forms.DataGridViewTextBoxColumn D_GradeAndWeight_ID; + private System.Windows.Forms.DataGridViewTextBoxColumn D_Code; + private System.Windows.Forms.DataGridViewTextBoxColumn D_Product_Name; + private System.Windows.Forms.DataGridViewTextBoxColumn D_Nubmber; + private System.Windows.Forms.DataGridViewTextBoxColumn D_State1Weight; + private System.Windows.Forms.DataGridViewTextBoxColumn D_State2Weight; + private System.Windows.Forms.DataGridViewTextBoxColumn D_State3Weight; + private System.Windows.Forms.DataGridViewTextBoxColumn D_Product_ID; + private System.Windows.Forms.DataGridViewTextBoxColumn D_State4Weight; + private System.Windows.Forms.DataGridViewTextBoxColumn D_State5Weight; + private System.Windows.Forms.DataGridViewTextBoxColumn D_CurrentState; + private System.Windows.Forms.DataGridViewTextBoxColumn D_CurrentWeight; + private System.Windows.Forms.DataGridViewTextBoxColumn D_Time; + private System.Windows.Forms.DataGridViewCheckBoxColumn cb_check; + private System.Windows.Forms.DataGridViewTextBoxColumn GradeAndWeight_ID; + private System.Windows.Forms.DataGridViewTextBoxColumn Code; + private System.Windows.Forms.DataGridViewTextBoxColumn Product_Name; + private System.Windows.Forms.DataGridViewTextBoxColumn Nubmber; + private System.Windows.Forms.DataGridViewTextBoxColumn State1Weight; + private System.Windows.Forms.DataGridViewTextBoxColumn Product_ID; + private System.Windows.Forms.DataGridViewTextBoxColumn State2Weight; + private System.Windows.Forms.DataGridViewTextBoxColumn State3Weight; + private System.Windows.Forms.DataGridViewTextBoxColumn State4Weight; + private System.Windows.Forms.DataGridViewTextBoxColumn State5Weight; + private System.Windows.Forms.DataGridViewTextBoxColumn CurrentState; + private System.Windows.Forms.DataGridViewTextBoxColumn CurrentWeight; + private System.Windows.Forms.DataGridViewTextBoxColumn Time; + } +} + diff --git a/CarcassStateWeight/CarcassStateWeightForm.cs b/CarcassStateWeight/CarcassStateWeightForm.cs new file mode 100644 index 0000000..28d0268 --- /dev/null +++ b/CarcassStateWeight/CarcassStateWeightForm.cs @@ -0,0 +1,407 @@ +using BO; +using BO.BO.Bill; +using BO.Utils; +using BO.Utils.BillRpc; +using BWP.WinFormControl; +using BWP.WinFormControl.WeightDataFormat; +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.IO.Ports; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using System.Windows.Forms; + + + +namespace CarcassStateWeight +{ + public partial class CarcassStateWeightForm : Form, IAfterLogin + { + + #region IAfterLogin + public string RoleName + { + get { return "定级员"; } + } + + public Form Generate() + { + return this; + } + #endregion + + List list; + List details; + Thread syncWork; + private delegate void InvokeHandler(); + + SerialPort weightPort; + int maxIndex = 0; + + + public CarcassStateWeightForm() + { + InitializeComponent(); + + houseList = ProductEntity.Init(BaseInfoRpcUtil.GetBaseInfoEntity("GetWhiteBarList")); + AddHouseBtn(); + details = new List(); + + } + + + + private void syncBtn_Click(object sender, EventArgs e) + { + list = CarcassStateWeightRpc.GetCarcassStateWeightList(butcherTimeInput.Date.Value); + BindDataGrid(); + //tangRow = FindRowSetSelected(tangEntity); + //maoRow = FindRowSetSelected(maoEntity); + dataGridViewSync.Refresh(); + + //if (syncWork == null || !syncWork.IsAlive) + //{ + // syncWork = new Thread(Sync); + // syncWork.Start(); + // syncBtn.BackColor = Color.FromArgb(15, 215, 107); + // syncBtn.ForeColor = Color.White; + //} + //else + //{ + // syncBtn.BackColor = Color.FromKnownColor(KnownColor.Control) + // syncWork.Abort();; + // syncBtn.ForeColor = Color.FromKnownColor(KnownColor.ControlText); + //} + } + + void Sync() + { + while (true) + { + Thread.Sleep(5000); + this.Invoke(new InvokeHandler(delegate () + { + list = CarcassStateWeightRpc.GetCarcassStateWeightList(butcherTimeInput.Date.Value); + BindDataGrid(); + //tangRow = FindRowSetSelected(tangEntity); + //maoRow = FindRowSetSelected(maoEntity); + dataGridViewSync.Refresh(); + })); + } + } + + void BindDataGrid() + { + dataGridViewSync.DataSource = list.OrderBy(x => x.Time).ToList(); + //foreach (DataGridViewRow row in dataGridViewSync.Rows) + //{ + // if ((bool)row.Cells["D_Finish"].Value) + // row.DefaultCellStyle.BackColor = Color.YellowGreen; + //} + } + + DataGridViewRow FindRowSetSelected(GradeAndWeight tag) + { + ////if (tag == null) + //// return null; + ////foreach (DataGridViewRow row in dataGridViewSync.Rows) + ////{ + //// if ((long)row.Cells["D_OrderDetail_ID"].Value == tag.OrderDetail_ID && (string)row.Cells["D_Technics_Name"].Value == tag.Technics_Name) + //// { + //// if (tag.Finish) + //// row.DefaultCellStyle.BackColor = Color.YellowGreen; + //// else + //// row.DefaultCellStyle.BackColor = tag.Technics == 1 ? Color.Yellow : dataGridViewSync.RowsDefaultCellStyle.SelectionBackColor; + + //// if (tag.Technics == 0) + //// tangEntity = row.DataBoundItem as GradeAndWeight; + //// else + //// maoEntity = row.DataBoundItem as GradeAndWeight; + //// return row; + //// } + ////} + return null; + } + + + + + + private void commitBtn_Click(object sender, EventArgs e) + { + List listCsw = new List(); + for (int i = 0; i < dataGridViewCode.Rows.Count; i++) + { + DataGridViewCheckBoxCell checkCell = (DataGridViewCheckBoxCell) dataGridViewCode.Rows[i].Cells["cb_check"]; + Boolean flag = Convert.ToBoolean(checkCell.Value); + if (flag == true) //查找被选择的数据行 + { + DataGridViewRow row = dataGridViewCode.Rows[i]; + BO.BO.Bill.CarcassStateWeight slectedCSW = row.DataBoundItem as BO.BO.Bill.CarcassStateWeight; + listCsw.Add(slectedCSW); + } + } + foreach (var csw in listCsw) + { + CarcassStateWeightRpc.UpdateOrInsertDetail(csw); + details.Remove(csw); + } + + dataGridViewCode.DataSource = null; + dataGridViewCode.DataSource = details; + dataGridViewCode.Refresh(); + + } + + + + + List