Browse Source

改成 重量添加明细

master
wugang 8 years ago
parent
commit
1f0fcef50b
5 changed files with 501 additions and 288 deletions
  1. +22
    -2
      BO/Utils/BillRpc/GradeAndWeightRpc.cs
  2. +19
    -19
      SegmentationWeight/SegmentationWeightForm.Designer.cs
  3. +5
    -2
      SegmentationWeight/SegmentationWeightForm.cs
  4. +179
    -164
      WeighAndGrading/GradeFrom.Designer.cs
  5. +276
    -101
      WeighAndGrading/GradeFrom.cs

+ 22
- 2
BO/Utils/BillRpc/GradeAndWeightRpc.cs View File

@ -6,6 +6,7 @@ using Forks.EnterpriseServices.SqlDoms;
using Forks.JsonRpc.Client; using Forks.JsonRpc.Client;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
@ -86,6 +87,17 @@ namespace BO.Utils.BillRpc
} }
} }
public static void DeleteBySID(long sid)
{
var delDom=new DQDeleteDom(typeof(GradeAndWeight_Detail));
delDom.Where.Conditions.Add(DQCondition.EQ("SID",sid));
using (var session = DmoSession.New())
{
session.ExecuteNonQuery(delDom);
session.Commit();
}
}
public static void UpdateLosted(long sid) public static void UpdateLosted(long sid)
{ {
var updateDom = new DQUpdateDom(typeof(GradeAndWeight_Detail)); var updateDom = new DQUpdateDom(typeof(GradeAndWeight_Detail));
@ -99,16 +111,24 @@ namespace BO.Utils.BillRpc
} }
} }
public static List<GradeAndWeight_Detail> GetDetails(DateTime date, int top = 15)
public static BindingList<GradeAndWeight_Detail> GetDetails(DateTime date, int top = 15)
{ {
var bindList=new BindingList<GradeAndWeight_Detail>();
var list=new List<GradeAndWeight_Detail>();
var query = new DmoQuery(typeof(GradeAndWeight_Detail)); var query = new DmoQuery(typeof(GradeAndWeight_Detail));
query.Where.Conditions.Add(DQCondition.EQ("Date", date)); query.Where.Conditions.Add(DQCondition.EQ("Date", date));
query.OrderBy.Expressions.Add(DQOrderByExpression.Create("Index", true)); query.OrderBy.Expressions.Add(DQOrderByExpression.Create("Index", true));
query.Range = SelectRange.Top(top); query.Range = SelectRange.Top(top);
using (var session = DmoSession.New()) using (var session = DmoSession.New())
{ {
return session.ExecuteList(query).Cast<GradeAndWeight_Detail>().ToList();
list= session.ExecuteList(query).Cast<GradeAndWeight_Detail>().ToList();
}
foreach (GradeAndWeight_Detail detail in list)
{
bindList.Add(detail);
} }
return bindList;
} }
public static int GetTangTuiSumNumber(DateTime date) public static int GetTangTuiSumNumber(DateTime date)


+ 19
- 19
SegmentationWeight/SegmentationWeightForm.Designer.cs View File

@ -28,9 +28,9 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle13 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle14 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle15 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle19 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle20 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle21 = new System.Windows.Forms.DataGridViewCellStyle();
this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.panel1 = new System.Windows.Forms.Panel(); this.panel1 = new System.Windows.Forms.Panel();
this.btnGoodsSet = new System.Windows.Forms.Button(); this.btnGoodsSet = new System.Windows.Forms.Button();
@ -160,7 +160,6 @@
// //
this.splitContainer2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.splitContainer2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill; this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer2.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
this.splitContainer2.Location = new System.Drawing.Point(0, 0); this.splitContainer2.Location = new System.Drawing.Point(0, 0);
this.splitContainer2.Name = "splitContainer2"; this.splitContainer2.Name = "splitContainer2";
// //
@ -180,8 +179,9 @@
// //
// flpGoods // flpGoods
// //
this.flpGoods.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.flpGoods.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.flpGoods.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.flpGoods.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.flpGoods.Location = new System.Drawing.Point(4, 87); this.flpGoods.Location = new System.Drawing.Point(4, 87);
this.flpGoods.Name = "flpGoods"; this.flpGoods.Name = "flpGoods";
@ -204,20 +204,20 @@
this.uDataGridView1.AllowUserToDeleteRows = false; this.uDataGridView1.AllowUserToDeleteRows = false;
this.uDataGridView1.AllowUserToResizeColumns = false; this.uDataGridView1.AllowUserToResizeColumns = false;
this.uDataGridView1.AllowUserToResizeRows = false; this.uDataGridView1.AllowUserToResizeRows = false;
dataGridViewCellStyle13.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
this.uDataGridView1.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle13;
dataGridViewCellStyle19.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
this.uDataGridView1.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle19;
this.uDataGridView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) this.uDataGridView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.uDataGridView1.BackgroundColor = System.Drawing.Color.White; this.uDataGridView1.BackgroundColor = System.Drawing.Color.White;
dataGridViewCellStyle14.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle14.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle14.Font = new System.Drawing.Font("宋体", 12F);
dataGridViewCellStyle14.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle14.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle14.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle14.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.uDataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle14;
dataGridViewCellStyle20.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle20.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle20.Font = new System.Drawing.Font("宋体", 12F);
dataGridViewCellStyle20.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle20.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle20.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle20.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.uDataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle20;
this.uDataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.uDataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.uDataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.uDataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this., this.,
@ -230,9 +230,9 @@
this.uDataGridView1.Name = "uDataGridView1"; this.uDataGridView1.Name = "uDataGridView1";
this.uDataGridView1.ReadOnly = true; this.uDataGridView1.ReadOnly = true;
this.uDataGridView1.RowHeadersVisible = false; this.uDataGridView1.RowHeadersVisible = false;
dataGridViewCellStyle15.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle15.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218)))));
this.uDataGridView1.RowsDefaultCellStyle = dataGridViewCellStyle15;
dataGridViewCellStyle21.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle21.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218)))));
this.uDataGridView1.RowsDefaultCellStyle = dataGridViewCellStyle21;
this.uDataGridView1.RowTemplate.Height = 23; this.uDataGridView1.RowTemplate.Height = 23;
this.uDataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.uDataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.uDataGridView1.Size = new System.Drawing.Size(483, 374); this.uDataGridView1.Size = new System.Drawing.Size(483, 374);


+ 5
- 2
SegmentationWeight/SegmentationWeightForm.cs View File

@ -36,7 +36,7 @@ namespace SegmentationWeight
public SegmentationWeightForm() public SegmentationWeightForm()
{ {
InitializeComponent(); InitializeComponent();
uDataGridView1.AutoGenerateColumns = false;
weightPort = new SerialPort(); weightPort = new SerialPort();
this.FormClosing += delegate this.FormClosing += delegate
{ {
@ -294,7 +294,8 @@ namespace SegmentationWeight
var btn=new Button(); var btn=new Button();
btn.Text = text; btn.Text = text;
btn.Click += Btn_Click; btn.Click += Btn_Click;
btn.Width = 100;
btn.Height = 60;
return btn; return btn;
} }
@ -329,6 +330,8 @@ namespace SegmentationWeight
btn.Text = set.Goods_Name; btn.Text = set.Goods_Name;
btn.Tag = set; btn.Tag = set;
btn.Click += BtnGoods_Click; btn.Click += BtnGoods_Click;
btn.Width = 100;
btn.Height = 60;
return btn; return btn;
} }


+ 179
- 164
WeighAndGrading/GradeFrom.Designer.cs View File

@ -28,19 +28,19 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle14 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle15 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle16 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle18 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle19 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle21 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle20 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle22 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle23 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle26 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle24 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle25 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle53 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle54 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle56 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle55 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle57 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle58 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle60 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle59 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle61 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle62 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle65 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle63 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle64 = new System.Windows.Forms.DataGridViewCellStyle();
this.label1 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label();
this.syncBtn = new System.Windows.Forms.Button(); this.syncBtn = new System.Windows.Forms.Button();
this.label2 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label();
@ -70,9 +70,19 @@
this.mbPanel = new System.Windows.Forms.FlowLayoutPanel(); this.mbPanel = new System.Windows.Forms.FlowLayoutPanel();
this.lblMaoBo = new System.Windows.Forms.Label(); this.lblMaoBo = new System.Windows.Forms.Label();
this.groupBox3 = new System.Windows.Forms.GroupBox(); this.groupBox3 = new System.Windows.Forms.GroupBox();
this.lblHeJi = new System.Windows.Forms.Label();
this.vScrollBar2 = new System.Windows.Forms.VScrollBar(); this.vScrollBar2 = new System.Windows.Forms.VScrollBar();
this.label12 = new System.Windows.Forms.Label(); this.label12 = new System.Windows.Forms.Label();
this.historyGrid = new BWP.WinFormControl.UDataGridView(); this.historyGrid = new BWP.WinFormControl.UDataGridView();
this.H_SID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.H_Livestock_ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.IsLostWeight = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.H_ReadWeight = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.H_Index = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.H_Technics = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.H_Livestock_Name = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.H_Weight = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.H_Time = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.enableWeight = new System.Windows.Forms.CheckBox(); this.enableWeight = new System.Windows.Forms.CheckBox();
this.isPrintCheckBox = new System.Windows.Forms.CheckBox(); this.isPrintCheckBox = new System.Windows.Forms.CheckBox();
this.printBtn = new System.Windows.Forms.Button(); this.printBtn = new System.Windows.Forms.Button();
@ -90,16 +100,7 @@
this.btnLockItem = new System.Windows.Forms.Button(); this.btnLockItem = new System.Windows.Forms.Button();
this.btnClearLast = new System.Windows.Forms.Button(); this.btnClearLast = new System.Windows.Forms.Button();
this.btnAbnormalModify = new System.Windows.Forms.Button(); this.btnAbnormalModify = new System.Windows.Forms.Button();
this.H_SID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.H_Livestock_ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.IsLostWeight = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.H_ReadWeight = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.H_Index = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.H_Technics = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.H_Livestock_Name = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.H_Weight = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.H_Time = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.lblHeJi = new System.Windows.Forms.Label();
this.lblSucessed = new System.Windows.Forms.Label();
this.groupBox1.SuspendLayout(); this.groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.tangGridView)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.tangGridView)).BeginInit();
this.groupBox2.SuspendLayout(); this.groupBox2.SuspendLayout();
@ -215,17 +216,17 @@
this.tangGridView.AllowUserToDeleteRows = false; this.tangGridView.AllowUserToDeleteRows = false;
this.tangGridView.AllowUserToResizeColumns = false; this.tangGridView.AllowUserToResizeColumns = false;
this.tangGridView.AllowUserToResizeRows = false; this.tangGridView.AllowUserToResizeRows = false;
dataGridViewCellStyle14.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
this.tangGridView.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle14;
dataGridViewCellStyle53.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
this.tangGridView.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle53;
this.tangGridView.BackgroundColor = System.Drawing.Color.White; this.tangGridView.BackgroundColor = System.Drawing.Color.White;
dataGridViewCellStyle15.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle15.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle15.Font = new System.Drawing.Font("宋体", 12F);
dataGridViewCellStyle15.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle15.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle15.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle15.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.tangGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle15;
dataGridViewCellStyle54.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle54.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle54.Font = new System.Drawing.Font("宋体", 12F);
dataGridViewCellStyle54.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle54.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle54.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle54.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.tangGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle54;
this.tangGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.tangGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.tangGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.tangGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.T_OrderDetail_ID, this.T_OrderDetail_ID,
@ -239,11 +240,11 @@
this.tangGridView.Name = "tangGridView"; this.tangGridView.Name = "tangGridView";
this.tangGridView.ReadOnly = true; this.tangGridView.ReadOnly = true;
this.tangGridView.RowHeadersVisible = false; this.tangGridView.RowHeadersVisible = false;
dataGridViewCellStyle17.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle17.ForeColor = System.Drawing.Color.Black;
dataGridViewCellStyle17.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218)))));
dataGridViewCellStyle17.SelectionForeColor = System.Drawing.Color.Black;
this.tangGridView.RowsDefaultCellStyle = dataGridViewCellStyle17;
dataGridViewCellStyle56.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle56.ForeColor = System.Drawing.Color.Black;
dataGridViewCellStyle56.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218)))));
dataGridViewCellStyle56.SelectionForeColor = System.Drawing.Color.Black;
this.tangGridView.RowsDefaultCellStyle = dataGridViewCellStyle56;
this.tangGridView.RowTemplate.Height = 50; this.tangGridView.RowTemplate.Height = 50;
this.tangGridView.ScrollBars = System.Windows.Forms.ScrollBars.None; this.tangGridView.ScrollBars = System.Windows.Forms.ScrollBars.None;
this.tangGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.tangGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
@ -293,9 +294,9 @@
// //
// T_FinishBtn // T_FinishBtn
// //
dataGridViewCellStyle16.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle16.Padding = new System.Windows.Forms.Padding(5, 10, 5, 10);
this.T_FinishBtn.DefaultCellStyle = dataGridViewCellStyle16;
dataGridViewCellStyle55.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle55.Padding = new System.Windows.Forms.Padding(5, 10, 5, 10);
this.T_FinishBtn.DefaultCellStyle = dataGridViewCellStyle55;
this.T_FinishBtn.HeaderText = "完毕"; this.T_FinishBtn.HeaderText = "完毕";
this.T_FinishBtn.Name = "T_FinishBtn"; this.T_FinishBtn.Name = "T_FinishBtn";
this.T_FinishBtn.ReadOnly = true; this.T_FinishBtn.ReadOnly = true;
@ -327,17 +328,17 @@
this.maoGridView.AllowUserToDeleteRows = false; this.maoGridView.AllowUserToDeleteRows = false;
this.maoGridView.AllowUserToResizeColumns = false; this.maoGridView.AllowUserToResizeColumns = false;
this.maoGridView.AllowUserToResizeRows = false; this.maoGridView.AllowUserToResizeRows = false;
dataGridViewCellStyle18.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
this.maoGridView.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle18;
dataGridViewCellStyle57.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
this.maoGridView.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle57;
this.maoGridView.BackgroundColor = System.Drawing.Color.White; this.maoGridView.BackgroundColor = System.Drawing.Color.White;
dataGridViewCellStyle19.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle19.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle19.Font = new System.Drawing.Font("宋体", 12F);
dataGridViewCellStyle19.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle19.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle19.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle19.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.maoGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle19;
dataGridViewCellStyle58.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle58.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle58.Font = new System.Drawing.Font("宋体", 12F);
dataGridViewCellStyle58.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle58.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle58.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle58.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.maoGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle58;
this.maoGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.maoGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.maoGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.maoGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.M_OrderDetail_ID, this.M_OrderDetail_ID,
@ -351,11 +352,11 @@
this.maoGridView.Name = "maoGridView"; this.maoGridView.Name = "maoGridView";
this.maoGridView.ReadOnly = true; this.maoGridView.ReadOnly = true;
this.maoGridView.RowHeadersVisible = false; this.maoGridView.RowHeadersVisible = false;
dataGridViewCellStyle21.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle21.ForeColor = System.Drawing.Color.Black;
dataGridViewCellStyle21.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218)))));
dataGridViewCellStyle21.SelectionForeColor = System.Drawing.Color.Black;
this.maoGridView.RowsDefaultCellStyle = dataGridViewCellStyle21;
dataGridViewCellStyle60.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle60.ForeColor = System.Drawing.Color.Black;
dataGridViewCellStyle60.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218)))));
dataGridViewCellStyle60.SelectionForeColor = System.Drawing.Color.Black;
this.maoGridView.RowsDefaultCellStyle = dataGridViewCellStyle60;
this.maoGridView.RowTemplate.Height = 50; this.maoGridView.RowTemplate.Height = 50;
this.maoGridView.ScrollBars = System.Windows.Forms.ScrollBars.Horizontal; this.maoGridView.ScrollBars = System.Windows.Forms.ScrollBars.Horizontal;
this.maoGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.maoGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
@ -405,9 +406,9 @@
// //
// M_FinishBtn // M_FinishBtn
// //
dataGridViewCellStyle20.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle20.Padding = new System.Windows.Forms.Padding(5, 10, 5, 10);
this.M_FinishBtn.DefaultCellStyle = dataGridViewCellStyle20;
dataGridViewCellStyle59.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle59.Padding = new System.Windows.Forms.Padding(5, 10, 5, 10);
this.M_FinishBtn.DefaultCellStyle = dataGridViewCellStyle59;
this.M_FinishBtn.HeaderText = "完毕"; this.M_FinishBtn.HeaderText = "完毕";
this.M_FinishBtn.Name = "M_FinishBtn"; this.M_FinishBtn.Name = "M_FinishBtn";
this.M_FinishBtn.ReadOnly = true; this.M_FinishBtn.ReadOnly = true;
@ -444,6 +445,16 @@
this.groupBox3.TabStop = false; this.groupBox3.TabStop = false;
this.groupBox3.Text = "记录"; this.groupBox3.Text = "记录";
// //
// lblHeJi
//
this.lblHeJi.AutoSize = true;
this.lblHeJi.Font = new System.Drawing.Font("宋体", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblHeJi.Location = new System.Drawing.Point(6, 624);
this.lblHeJi.Name = "lblHeJi";
this.lblHeJi.Size = new System.Drawing.Size(82, 24);
this.lblHeJi.TabIndex = 53;
this.lblHeJi.Text = "合计:";
//
// vScrollBar2 // vScrollBar2
// //
this.vScrollBar2.Location = new System.Drawing.Point(425, 36); this.vScrollBar2.Location = new System.Drawing.Point(425, 36);
@ -467,17 +478,17 @@
this.historyGrid.AllowUserToDeleteRows = false; this.historyGrid.AllowUserToDeleteRows = false;
this.historyGrid.AllowUserToResizeColumns = false; this.historyGrid.AllowUserToResizeColumns = false;
this.historyGrid.AllowUserToResizeRows = false; this.historyGrid.AllowUserToResizeRows = false;
dataGridViewCellStyle22.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
this.historyGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle22;
dataGridViewCellStyle61.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
this.historyGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle61;
this.historyGrid.BackgroundColor = System.Drawing.Color.White; this.historyGrid.BackgroundColor = System.Drawing.Color.White;
dataGridViewCellStyle23.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle23.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle23.Font = new System.Drawing.Font("宋体", 12F);
dataGridViewCellStyle23.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle23.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle23.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle23.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.historyGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle23;
dataGridViewCellStyle62.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle62.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle62.Font = new System.Drawing.Font("宋体", 12F);
dataGridViewCellStyle62.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle62.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle62.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle62.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.historyGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle62;
this.historyGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.historyGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.historyGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.historyGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.H_SID, this.H_SID,
@ -494,9 +505,9 @@
this.historyGrid.Name = "historyGrid"; this.historyGrid.Name = "historyGrid";
this.historyGrid.ReadOnly = true; this.historyGrid.ReadOnly = true;
this.historyGrid.RowHeadersVisible = false; this.historyGrid.RowHeadersVisible = false;
dataGridViewCellStyle26.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle26.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218)))));
this.historyGrid.RowsDefaultCellStyle = dataGridViewCellStyle26;
dataGridViewCellStyle65.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle65.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218)))));
this.historyGrid.RowsDefaultCellStyle = dataGridViewCellStyle65;
this.historyGrid.RowTemplate.Height = 40; this.historyGrid.RowTemplate.Height = 40;
this.historyGrid.ScrollBars = System.Windows.Forms.ScrollBars.None; this.historyGrid.ScrollBars = System.Windows.Forms.ScrollBars.None;
this.historyGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.historyGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
@ -504,6 +515,81 @@
this.historyGrid.TabIndex = 0; this.historyGrid.TabIndex = 0;
this.historyGrid.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.historyGrid_CellClick); this.historyGrid.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.historyGrid_CellClick);
// //
// H_SID
//
this.H_SID.DataPropertyName = "SID";
this.H_SID.HeaderText = "SID";
this.H_SID.Name = "H_SID";
this.H_SID.ReadOnly = true;
this.H_SID.Visible = false;
//
// H_Livestock_ID
//
this.H_Livestock_ID.HeaderText = "Livestock_ID";
this.H_Livestock_ID.Name = "H_Livestock_ID";
this.H_Livestock_ID.ReadOnly = true;
this.H_Livestock_ID.Visible = false;
//
// IsLostWeight
//
this.IsLostWeight.DataPropertyName = "IsLostWeight";
this.IsLostWeight.HeaderText = "IsLostWeight";
this.IsLostWeight.Name = "IsLostWeight";
this.IsLostWeight.ReadOnly = true;
this.IsLostWeight.Visible = false;
//
// H_ReadWeight
//
this.H_ReadWeight.DataPropertyName = "ReadWeight";
this.H_ReadWeight.HeaderText = "";
this.H_ReadWeight.Name = "H_ReadWeight";
this.H_ReadWeight.ReadOnly = true;
this.H_ReadWeight.Width = 30;
//
// H_Index
//
this.H_Index.DataPropertyName = "Index";
this.H_Index.HeaderText = "序号";
this.H_Index.Name = "H_Index";
this.H_Index.ReadOnly = true;
this.H_Index.Width = 65;
//
// H_Technics
//
this.H_Technics.DataPropertyName = "Technics_Name";
this.H_Technics.HeaderText = "工艺";
this.H_Technics.Name = "H_Technics";
this.H_Technics.ReadOnly = true;
this.H_Technics.Width = 65;
//
// H_Livestock_Name
//
this.H_Livestock_Name.DataPropertyName = "Livestock_Name";
this.H_Livestock_Name.HeaderText = "级别";
this.H_Livestock_Name.Name = "H_Livestock_Name";
this.H_Livestock_Name.ReadOnly = true;
this.H_Livestock_Name.Width = 90;
//
// H_Weight
//
this.H_Weight.DataPropertyName = "Weight";
dataGridViewCellStyle63.Format = "#0.######";
this.H_Weight.DefaultCellStyle = dataGridViewCellStyle63;
this.H_Weight.HeaderText = "重量";
this.H_Weight.Name = "H_Weight";
this.H_Weight.ReadOnly = true;
this.H_Weight.Width = 70;
//
// H_Time
//
this.H_Time.DataPropertyName = "Time";
dataGridViewCellStyle64.Format = "HH:mm:ss";
dataGridViewCellStyle64.NullValue = null;
this.H_Time.DefaultCellStyle = dataGridViewCellStyle64;
this.H_Time.HeaderText = "时间";
this.H_Time.Name = "H_Time";
this.H_Time.ReadOnly = true;
//
// enableWeight // enableWeight
// //
this.enableWeight.AutoCheck = false; this.enableWeight.AutoCheck = false;
@ -577,7 +663,7 @@
// closeBtn // closeBtn
// //
this.closeBtn.Font = new System.Drawing.Font("宋体", 15F); this.closeBtn.Font = new System.Drawing.Font("宋体", 15F);
this.closeBtn.Location = new System.Drawing.Point(1272, 20);
this.closeBtn.Location = new System.Drawing.Point(1256, 20);
this.closeBtn.Name = "closeBtn"; this.closeBtn.Name = "closeBtn";
this.closeBtn.Size = new System.Drawing.Size(102, 60); this.closeBtn.Size = new System.Drawing.Size(102, 60);
this.closeBtn.TabIndex = 33; this.closeBtn.TabIndex = 33;
@ -660,29 +746,30 @@
// btnLockItem // btnLockItem
// //
this.btnLockItem.Font = new System.Drawing.Font("宋体", 15F); this.btnLockItem.Font = new System.Drawing.Font("宋体", 15F);
this.btnLockItem.Location = new System.Drawing.Point(903, 20);
this.btnLockItem.Location = new System.Drawing.Point(867, 2);
this.btnLockItem.Name = "btnLockItem"; this.btnLockItem.Name = "btnLockItem";
this.btnLockItem.Size = new System.Drawing.Size(102, 60);
this.btnLockItem.Size = new System.Drawing.Size(102, 25);
this.btnLockItem.TabIndex = 34; this.btnLockItem.TabIndex = 34;
this.btnLockItem.Text = "锁定"; this.btnLockItem.Text = "锁定";
this.btnLockItem.UseVisualStyleBackColor = true; this.btnLockItem.UseVisualStyleBackColor = true;
this.btnLockItem.Visible = false;
this.btnLockItem.Click += new System.EventHandler(this.btnLockItem_Click); this.btnLockItem.Click += new System.EventHandler(this.btnLockItem_Click);
// //
// btnClearLast // btnClearLast
// //
this.btnClearLast.Font = new System.Drawing.Font("宋体", 15F); this.btnClearLast.Font = new System.Drawing.Font("宋体", 15F);
this.btnClearLast.Location = new System.Drawing.Point(1027, 20);
this.btnClearLast.Location = new System.Drawing.Point(1011, 20);
this.btnClearLast.Name = "btnClearLast"; this.btnClearLast.Name = "btnClearLast";
this.btnClearLast.Size = new System.Drawing.Size(102, 60); this.btnClearLast.Size = new System.Drawing.Size(102, 60);
this.btnClearLast.TabIndex = 34; this.btnClearLast.TabIndex = 34;
this.btnClearLast.Text = "清空";
this.btnClearLast.Text = "删除";
this.btnClearLast.UseVisualStyleBackColor = true; this.btnClearLast.UseVisualStyleBackColor = true;
this.btnClearLast.Click += new System.EventHandler(this.btnClearLast_Click); this.btnClearLast.Click += new System.EventHandler(this.btnClearLast_Click);
// //
// btnAbnormalModify // btnAbnormalModify
// //
this.btnAbnormalModify.Font = new System.Drawing.Font("宋体", 15F); this.btnAbnormalModify.Font = new System.Drawing.Font("宋体", 15F);
this.btnAbnormalModify.Location = new System.Drawing.Point(1149, 20);
this.btnAbnormalModify.Location = new System.Drawing.Point(1133, 20);
this.btnAbnormalModify.Name = "btnAbnormalModify"; this.btnAbnormalModify.Name = "btnAbnormalModify";
this.btnAbnormalModify.Size = new System.Drawing.Size(102, 60); this.btnAbnormalModify.Size = new System.Drawing.Size(102, 60);
this.btnAbnormalModify.TabIndex = 34; this.btnAbnormalModify.TabIndex = 34;
@ -690,96 +777,25 @@
this.btnAbnormalModify.UseVisualStyleBackColor = true; this.btnAbnormalModify.UseVisualStyleBackColor = true;
this.btnAbnormalModify.Click += new System.EventHandler(this.btnAbnormalModify_Click); this.btnAbnormalModify.Click += new System.EventHandler(this.btnAbnormalModify_Click);
// //
// H_SID
// lblSucessed
// //
this.H_SID.DataPropertyName = "SID";
this.H_SID.HeaderText = "SID";
this.H_SID.Name = "H_SID";
this.H_SID.ReadOnly = true;
this.H_SID.Visible = false;
//
// H_Livestock_ID
//
this.H_Livestock_ID.HeaderText = "Livestock_ID";
this.H_Livestock_ID.Name = "H_Livestock_ID";
this.H_Livestock_ID.ReadOnly = true;
this.H_Livestock_ID.Visible = false;
//
// IsLostWeight
//
this.IsLostWeight.DataPropertyName = "IsLostWeight";
this.IsLostWeight.HeaderText = "IsLostWeight";
this.IsLostWeight.Name = "IsLostWeight";
this.IsLostWeight.ReadOnly = true;
this.IsLostWeight.Visible = false;
//
// H_ReadWeight
//
this.H_ReadWeight.DataPropertyName = "ReadWeight";
this.H_ReadWeight.HeaderText = "";
this.H_ReadWeight.Name = "H_ReadWeight";
this.H_ReadWeight.ReadOnly = true;
this.H_ReadWeight.Width = 30;
//
// H_Index
//
this.H_Index.DataPropertyName = "Index";
this.H_Index.HeaderText = "序号";
this.H_Index.Name = "H_Index";
this.H_Index.ReadOnly = true;
this.H_Index.Width = 65;
//
// H_Technics
//
this.H_Technics.DataPropertyName = "Technics_Name";
this.H_Technics.HeaderText = "工艺";
this.H_Technics.Name = "H_Technics";
this.H_Technics.ReadOnly = true;
this.H_Technics.Width = 65;
//
// H_Livestock_Name
//
this.H_Livestock_Name.DataPropertyName = "Livestock_Name";
this.H_Livestock_Name.HeaderText = "级别";
this.H_Livestock_Name.Name = "H_Livestock_Name";
this.H_Livestock_Name.ReadOnly = true;
this.H_Livestock_Name.Width = 90;
//
// H_Weight
//
this.H_Weight.DataPropertyName = "Weight";
dataGridViewCellStyle24.Format = "#0.######";
this.H_Weight.DefaultCellStyle = dataGridViewCellStyle24;
this.H_Weight.HeaderText = "重量";
this.H_Weight.Name = "H_Weight";
this.H_Weight.ReadOnly = true;
this.H_Weight.Width = 70;
//
// H_Time
//
this.H_Time.DataPropertyName = "Time";
dataGridViewCellStyle25.Format = "HH:mm:ss";
dataGridViewCellStyle25.NullValue = null;
this.H_Time.DefaultCellStyle = dataGridViewCellStyle25;
this.H_Time.HeaderText = "时间";
this.H_Time.Name = "H_Time";
this.H_Time.ReadOnly = true;
//
// lblHeJi
//
this.lblHeJi.AutoSize = true;
this.lblHeJi.Font = new System.Drawing.Font("宋体", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblHeJi.Location = new System.Drawing.Point(6, 624);
this.lblHeJi.Name = "lblHeJi";
this.lblHeJi.Size = new System.Drawing.Size(82, 24);
this.lblHeJi.TabIndex = 53;
this.lblHeJi.Text = "合计:";
this.lblSucessed.BackColor = System.Drawing.Color.Lime;
this.lblSucessed.Font = new System.Drawing.Font("宋体", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblSucessed.ForeColor = System.Drawing.Color.Red;
this.lblSucessed.Location = new System.Drawing.Point(691, 70);
this.lblSucessed.Name = "lblSucessed";
this.lblSucessed.Size = new System.Drawing.Size(267, 39);
this.lblSucessed.TabIndex = 39;
this.lblSucessed.Text = "插入级别成功";
this.lblSucessed.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.lblSucessed.Visible = false;
// //
// GradeFrom // GradeFrom
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1379, 842);
this.ClientSize = new System.Drawing.Size(1382, 843);
this.Controls.Add(this.lblSucessed);
this.Controls.Add(this.statePic); this.Controls.Add(this.statePic);
this.Controls.Add(this.discontPanel); this.Controls.Add(this.discontPanel);
this.Controls.Add(this.lblMaoBo); this.Controls.Add(this.lblMaoBo);
@ -805,13 +821,11 @@
this.Controls.Add(this.butcherTimeInput); this.Controls.Add(this.butcherTimeInput);
this.Controls.Add(this.label1); this.Controls.Add(this.label1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.KeyPreview = true;
this.MaximizeBox = false; this.MaximizeBox = false;
this.Name = "GradeFrom"; this.Name = "GradeFrom";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "称重定级"; this.Text = "称重定级";
this.Load += new System.EventHandler(this.GradeFrom_Load); this.Load += new System.EventHandler(this.GradeFrom_Load);
this.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.GradeFrom_KeyPress);
this.groupBox1.ResumeLayout(false); this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout(); this.groupBox1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.tangGridView)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.tangGridView)).EndInit();
@ -891,5 +905,6 @@
private System.Windows.Forms.DataGridViewTextBoxColumn H_Weight; private System.Windows.Forms.DataGridViewTextBoxColumn H_Weight;
private System.Windows.Forms.DataGridViewTextBoxColumn H_Time; private System.Windows.Forms.DataGridViewTextBoxColumn H_Time;
private System.Windows.Forms.Label lblHeJi; private System.Windows.Forms.Label lblHeJi;
private System.Windows.Forms.Label lblSucessed;
} }
} }

+ 276
- 101
WeighAndGrading/GradeFrom.cs View File

@ -45,7 +45,7 @@ namespace WeighAndGrading
const short MAO_TECH = 1; const short MAO_TECH = 1;
List<GradeAndWeight> tangList; List<GradeAndWeight> tangList;
List<GradeAndWeight> maoList; List<GradeAndWeight> maoList;
List<GradeAndWeight_Detail> details;
BindingList<GradeAndWeight_Detail> details;
List<long> localTang, localMao; List<long> localTang, localMao;
string maoFilePath, tangFilePath; string maoFilePath, tangFilePath;
@ -97,29 +97,29 @@ namespace WeighAndGrading
GradeAndWeight_Detail modifyDetail; GradeAndWeight_Detail modifyDetail;
private void GradeFrom_KeyPress(object sender, KeyPressEventArgs e)
{
Char keyChar = e.KeyChar;
var key = keyChar.ToString().ToLower();
foreach (Button btn in ttPanel.Controls)
{
var livestockTag = btn.Tag as CTuple<long, string, short, string>;
if (livestockTag.Item4.ToLower() == key)
{
JiBieButtonClick(btn);
SetJiBieSelectBackColor(btn.Text);
}
}
foreach (Button btn in mbPanel.Controls)
{
var livestockTag = btn.Tag as CTuple<long, string, short, string>;
if (livestockTag.Item4.ToLower() == key)
{
JiBieButtonClick(btn);
SetJiBieSelectBackColor(btn.Text);
}
}
}
// private void GradeFrom_KeyPress(object sender, KeyPressEventArgs e)
// {
// Char keyChar = e.KeyChar;
// var key = keyChar.ToString().ToLower();
// foreach (Button btn in ttPanel.Controls)
// {
// var livestockTag = btn.Tag as CTuple<long, string, short, string>;
// if (livestockTag.Item4.ToLower() == key)
// {
// JiBieButtonClick(btn);
// SetJiBieSelectBackColor(btn.Text);
// }
// }
// foreach (Button btn in mbPanel.Controls)
// {
// var livestockTag = btn.Tag as CTuple<long, string, short, string>;
// if (livestockTag.Item4.ToLower() == key)
// {
// JiBieButtonClick(btn);
// SetJiBieSelectBackColor(btn.Text);
// }
// }
// }
//点击 级别 //点击 级别
void JiBieButtonClick(Button btn) void JiBieButtonClick(Button btn)
@ -129,6 +129,9 @@ namespace WeighAndGrading
MessageBox.Show("请先同步数据"); MessageBox.Show("请先同步数据");
return; return;
} }
SetlblSucessVisibleTrue();
var livestockTag = btn.Tag as CTuple<long, string, short, string>; var livestockTag = btn.Tag as CTuple<long, string, short, string>;
if (modifyDetail == null) if (modifyDetail == null)
AddDetail(livestockTag); AddDetail(livestockTag);
@ -143,6 +146,8 @@ namespace WeighAndGrading
modifyDetail = null; modifyDetail = null;
modifyPanel.Hide(); modifyPanel.Hide();
} }
SetlblSucessVisibleFalse();
} }
void AddLivestockBtn() void AddLivestockBtn()
@ -158,7 +163,7 @@ namespace WeighAndGrading
livestocks = XmlUtil.DeserializeFromFile<List<CTuple<long, string, short, string>>>(fileName); livestocks = XmlUtil.DeserializeFromFile<List<CTuple<long, string, short, string>>>(fileName);
foreach (var item in livestocks) foreach (var item in livestocks)
{ {
var btn = new Button() { Name = "_" + item.Item1, Text = item.Item2 + "(" + item.Item4.ToLower() + ")", Tag = item, Size = new Size(90, 75), TextAlign = ContentAlignment.MiddleCenter, Margin = new Padding { All = 15 }, Font = new Font("宋体", 18) };
var btn = new Button() { Name = "_" + item.Item1, Text = item.Item2 , Tag = item, Size = new Size(90, 75), TextAlign = ContentAlignment.MiddleCenter, Margin = new Padding { All = 15 }, Font = new Font("宋体", 18) };
btn.Click += (sender, e) => btn.Click += (sender, e) =>
{ {
@ -198,12 +203,16 @@ namespace WeighAndGrading
}; };
if (item.Item3 == TANG_TECH) if (item.Item3 == TANG_TECH)
{ {
btn.Click += delegate { SetJiBieSelectBackColor(btn.Text); };
btn.KeyDown += Btn_KeyDown;
btn.KeyUp += Btn_KeyUp;
ttPanel.Controls.Add(btn); ttPanel.Controls.Add(btn);
} }
else else
{ {
btn.Click += delegate { SetJiBieSelectBackColor(btn.Text); };
btn.KeyDown += Btn_KeyDown;
btn.KeyUp += Btn_KeyUp;
mbPanel.Controls.Add(btn); mbPanel.Controls.Add(btn);
} }
} }
@ -211,34 +220,46 @@ namespace WeighAndGrading
SetMargin(mbPanel); SetMargin(mbPanel);
} }
private void SetJiBieSelectBackColor(string btnText)
private void Btn_KeyUp(object sender, KeyEventArgs e)
{ {
foreach (Control control in ttPanel.Controls)
{
if (control.Text == btnText)
{
control.BackColor = Color.Aqua;
}
else
{
control.BackColor = SystemColors.Control;
}
}
foreach (Control control in mbPanel.Controls)
{
if (control.Text == btnText)
{
control.BackColor = Color.Aqua;
}
else
{
control.BackColor = SystemColors.Control;
}
}
var btn = sender as Button;
btn.BackColor = SystemColors.Control;
}
private void Btn_KeyDown(object sender, KeyEventArgs e)
{
var btn = sender as Button;
btn.BackColor = Color.Aqua;
} }
// private void SetJiBieSelectBackColor(string btnText)
// {
// foreach (Control control in ttPanel.Controls)
// {
// if (control.Text == btnText)
// {
// control.BackColor = Color.Aqua;
// }
// else
// {
// control.BackColor = SystemColors.Control;
// }
// }
//
// foreach (Control control in mbPanel.Controls)
// {
// if (control.Text == btnText)
// {
// control.BackColor = Color.Aqua;
// }
// else
// {
// control.BackColor = SystemColors.Control;
// }
// }
//
// }
void SetMargin(FlowLayoutPanel panel) void SetMargin(FlowLayoutPanel panel)
{ {
@ -575,12 +596,12 @@ namespace WeighAndGrading
var allowInterval = GradeContext.Config.AllowInterval; var allowInterval = GradeContext.Config.AllowInterval;
//如果间隔时间内多条的话不处理 //如果间隔时间内多条的话不处理
var timeSpanTotalSeconds= (DateTime.Now - lastWeightDateTime).TotalSeconds;
if (Convert.ToDecimal(timeSpanTotalSeconds) > allowInterval)
{
// var timeSpanTotalSeconds= (DateTime.Now - lastWeightDateTime).TotalSeconds;
// if (Convert.ToDecimal(timeSpanTotalSeconds) > allowInterval)
// {
AddWeightDetail(decimal.Parse(lblChengZhong.Text)); AddWeightDetail(decimal.Parse(lblChengZhong.Text));
lastWeightDateTime = DateTime.Now;
}
// lastWeightDateTime = DateTime.Now;
// }
} }
})); }));
@ -699,7 +720,81 @@ namespace WeighAndGrading
static object _obj = new object(); static object _obj = new object();
void AddDetail(CTuple<long, string, short, string> livestock)
// void AddDetail(CTuple<long, string, short, string> livestock)
// {
// lock (_obj)
// {
// var currentRow = livestock.Item3 == 0 ? tangEntity : maoEntity;
// var tech = livestock.Item3 == TANG_TECH ? "烫褪" : "毛剥";
//
// GradeAndWeight_Detail first;
// if (noLivestockList.TryPeek(out first) && first.Livestock_ID == null)
// {
// noLivestockList.TryDequeue(out first);
// if (currentRow != null)
// first.OrderDetail_ID = currentRow.OrderDetail_ID;
// first.Date = butcherTimeInput.Date.Value;
// first.Livestock_ID = livestock.Item1;
// first.Livestock_Name = livestock.Item2;
// first.Technics = livestock.Item3;
// first.Technics_Name = tech;
// if (disBtn != null)
// {
// first.Weight = (first.Weight ?? 0) - Convert.ToDecimal(disBtn.Tag);
// SetBtnUnCheck(disBtn);
// disBtn = null;
// }
// LocalGradeAndWeightBL.Update(first, "OrderDetail_ID", "Date", "Livestock_ID", "Livestock_Name", "Technics", "Technics_Name", "Weight");
// historyGrid.Refresh();
// }
// else//add
// {
// maxIndex++;
// var entity = new GradeAndWeight_Detail();
// entity.Index = maxIndex;
// if (currentRow != null)
// entity.OrderDetail_ID = currentRow.OrderDetail_ID;
// entity.Date = butcherTimeInput.Date.Value;
// entity.Livestock_ID = livestock.Item1;
// entity.Livestock_Name = livestock.Item2;
// entity.Technics = livestock.Item3;
// entity.Technics_Name = tech;
// entity.Time = DateTime.Now;
// entity.Date = butcherTimeInput.Date.Value;
// if (disBtn != null)
// {
// entity.Weight = -Convert.ToDecimal(disBtn.Tag);
// SetBtnUnCheck(disBtn);
// disBtn = null;
// }
// if (details.Count == 50)
// details.RemoveAt(49);
// details.Insert(0, entity);
// LocalGradeAndWeightBL.Insert(entity);
// noWeightList.Enqueue(entity);
// BindDetailGrid();
// }
// if (currentRow != null)
// {
// currentRow.Already = currentRow.Already + 1;
// orderLabel.Text = currentRow.Order.ToString();
// alreadyLabel.Text = currentRow.Already.ToString();
// tangGridView.Refresh();
// }
// else
// {
// orderLabel.Text = string.Empty;
// alreadyLabel.Text = string.Empty;
// }
//
// //计算合计
// ReSetHistorySum();
// }
// }
void AddDetail(CTuple<long, string, short, string> livestock)
{ {
lock (_obj) lock (_obj)
{ {
@ -726,7 +821,7 @@ namespace WeighAndGrading
LocalGradeAndWeightBL.Update(first, "OrderDetail_ID", "Date", "Livestock_ID", "Livestock_Name", "Technics", "Technics_Name", "Weight"); LocalGradeAndWeightBL.Update(first, "OrderDetail_ID", "Date", "Livestock_ID", "Livestock_Name", "Technics", "Technics_Name", "Weight");
historyGrid.Refresh(); historyGrid.Refresh();
} }
else//add
else//add
{ {
maxIndex++; maxIndex++;
var entity = new GradeAndWeight_Detail(); var entity = new GradeAndWeight_Detail();
@ -746,12 +841,17 @@ namespace WeighAndGrading
SetBtnUnCheck(disBtn); SetBtnUnCheck(disBtn);
disBtn = null; disBtn = null;
} }
//如果手动点击新增明细,则明细的重量=0
entity.Weight = 0;
entity.IsLostWeight = true;
if (details.Count == 50) if (details.Count == 50)
details.RemoveAt(49); details.RemoveAt(49);
details.Insert(0, entity); details.Insert(0, entity);
LocalGradeAndWeightBL.Insert(entity); LocalGradeAndWeightBL.Insert(entity);
noWeightList.Enqueue(entity);
// noWeightList.Enqueue(entity); // 添加的掉猪明细不加入到没有称重队列
BindDetailGrid(); BindDetailGrid();
} }
if (currentRow != null) if (currentRow != null)
{ {
@ -771,6 +871,22 @@ namespace WeighAndGrading
} }
} }
void SetlblSucessVisibleFalse()
{
this.Invoke(new Action(() =>
{
Thread.Sleep(1000);
lblSucessed.Visible = false;
}));
}
void SetlblSucessVisibleTrue()
{
lblSucessed.Visible = true;
Application.DoEvents();
}
void ReSetHistorySum() void ReSetHistorySum()
{ {
var tangtui=LocalGradeAndWeightBL.GetTangTuiSumNumber(butcherTimeInput.Date.Value); var tangtui=LocalGradeAndWeightBL.GetTangTuiSumNumber(butcherTimeInput.Date.Value);
@ -784,33 +900,36 @@ namespace WeighAndGrading
lock (_obj) lock (_obj)
{ {
weight -= (GradeContext.Config.Discont ?? 0); weight -= (GradeContext.Config.Discont ?? 0);
GradeAndWeight_Detail first;
if (noWeightList.TryPeek(out first))
{
noWeightList.TryDequeue(out first);
if (first.Weight < 0)
first.Weight = (first.Weight ?? 0) + weight;
else
first.Weight = weight;
LocalGradeAndWeightBL.Update(first, "Weight");
historyGrid.Refresh();
}
else//add
// GradeAndWeight_Detail first;
// if (noWeightList.TryPeek(out first))
// {
// noWeightList.TryDequeue(out first);
// if (first.Weight < 0)
// first.Weight = (first.Weight ?? 0) + weight;
// else
// first.Weight = weight;
// LocalGradeAndWeightBL.Update(first, "Weight");
// historyGrid.Refresh();
// }
// else//add
{ {
//todo 目前先去掉 称重增加记录的功能
// maxIndex++;
// var entity = new GradeAndWeight_Detail();
// entity.Index = maxIndex;
// entity.Weight = (entity.Weight ?? 0) + weight;
// entity.Time = DateTime.Now;
// entity.Date = butcherTimeInput.Date.Value;
// if (details.Count == 50)
// details.RemoveAt(49);
// details.Insert(0, entity);
// LocalGradeAndWeightBL.Insert(entity);
// noLivestockList.Enqueue(entity);
// BindDetailGrid();
maxIndex++;
var entity = new GradeAndWeight_Detail();
entity.Index = maxIndex;
entity.Weight = (entity.Weight ?? 0) + weight;
entity.Time = DateTime.Now;
entity.Date = butcherTimeInput.Date.Value;
if (details.Count == 50)
details.RemoveAt(49);
details.Insert(0, entity);
LocalGradeAndWeightBL.Insert(entity);
noLivestockList.Enqueue(entity);
BindDetailGrid();
// SetlblSucessVisibleTrue();
// SetlblSucessVisibleFalse();
} }
} }
@ -826,36 +945,92 @@ namespace WeighAndGrading
private void btnClearLast_Click(object sender, EventArgs e) private void btnClearLast_Click(object sender, EventArgs e)
{ {
// if (MessageBox.Show("确定清空最后一次称重?", "确定清空最后一次称重?", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
if (MessageBox.Show("确定删除最后一条记录?", "确定删除最后一条记录?", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
{
return;
}
// if (mCurrentSlectItem == null)
// {
// return;
// }
#region 原来逻辑 清空最后一条有重量的值
// //有称重重量的 并且不是掉猪的最大的一条
// var fuhemaxsid = details.Where(x => x.Weight.HasValue && !x.IsLostWeight).Max(x => x.SID);
// var fd = details.First(x => x.SID == fuhemaxsid);
// fd.Weight = null;
//
// //清空数据库重量记录
// LocalGradeAndWeightBL.ClearWeightBySID(fuhemaxsid);
// historyGrid.Refresh();
//
// noWeightList = new ConcurrentQueue<GradeAndWeight_Detail>();
// var stack = new Stack<GradeAndWeight_Detail>();
// foreach (var item in details)
// { // {
// return;
// if (item.SID > fd.SID)
// {
// stack.Push(item);
// }
// } // }
// if (mCurrentSlectItem == null)
// while (stack.Count > 0)
// { // {
// return;
// noWeightList.Enqueue(stack.Pop());
// } // }
#endregion
//有称重重量的 并且不是掉猪的最大的一条
var fuhemaxsid = details.Where(x => x.Weight.HasValue && !x.IsLostWeight).Max(x => x.SID);
var fd = details.First(x => x.SID == fuhemaxsid);
fd.Weight = null;
if (details.Count == 0)
{
return;
}
var lastItem = details[0];
//如果级别不为空 则返回
if (!string.IsNullOrWhiteSpace(lastItem.Livestock_Name))
{
return;
}
//清空数据库重量记录
LocalGradeAndWeightBL.ClearWeightBySID(fuhemaxsid);
details.RemoveAt(0);
//删除数据库
LocalGradeAndWeightBL.DeleteBySID(lastItem.SID);
historyGrid.Refresh(); historyGrid.Refresh();
noWeightList = new ConcurrentQueue<GradeAndWeight_Detail>();
//从新赋值 没有级别的
// noLivestockList=new ConcurrentQueue<GradeAndWeight_Detail>();
//
//
//
// GradeAndWeight_Detail first;
// if (noLivestockList.TryPeek(out first) && first.Livestock_ID == null)
// {
// noLivestockList.TryDequeue(out first);
// }
//重新设置没有级别的
noLivestockList = new ConcurrentQueue<GradeAndWeight_Detail>();
var stack = new Stack<GradeAndWeight_Detail>(); var stack = new Stack<GradeAndWeight_Detail>();
foreach (var item in details)
//找到锁定的最大id
var suodingmaxsid = details.Where(x => x.IsLostWeight).Max(x => x.SID);
//把没有级别的记录加进去
var livestockNoNameList = details.Where(x => string.IsNullOrWhiteSpace(x.Livestock_Name));
foreach (var item in livestockNoNameList)
{ {
if (item.SID >= fd.SID)
if (item.SID > suodingmaxsid)
{ {
stack.Push(item); stack.Push(item);
} }
} }
while (stack.Count > 0) while (stack.Count > 0)
noWeightList.Enqueue(stack.Pop());
{
noLivestockList.Enqueue(stack.Pop());
}
} }
private void btnLockItem_Click(object sender, EventArgs e) private void btnLockItem_Click(object sender, EventArgs e)
@ -910,7 +1085,7 @@ namespace WeighAndGrading
foreach (DataGridViewRow row in historyGrid.Rows) foreach (DataGridViewRow row in historyGrid.Rows)
{ {
if ((bool)row.Cells["IsLostWeight"].Value) if ((bool)row.Cells["IsLostWeight"].Value)
row.DefaultCellStyle.BackColor = Color.Red;
row.DefaultCellStyle.ForeColor = Color.Red;
} }
} }


Loading…
Cancel
Save