Browse Source

修改。

master
yibo 8 years ago
parent
commit
5548e61e69
3 changed files with 260 additions and 163 deletions
  1. +26
    -6
      BO/Utils/BillRpc/GradeAndWeightRpc.cs
  2. +211
    -155
      WeighAndGrading/DataConfirm.Designer.cs
  3. +23
    -2
      WeighAndGrading/DataConfirm.cs

+ 26
- 6
BO/Utils/BillRpc/GradeAndWeightRpc.cs View File

@ -170,22 +170,30 @@ namespace BO.Utils.BillRpc
// }
//}
public static List<Tuple<short, int>> GetSumNumber(DateTime date, int? order)
public static List<Tuple<short, int, decimal>> GetSumNumber(DateTime date, int? order, short? type)
{
var query = new DQueryDom(new JoinAlias(typeof(GradeAndWeight_Detail)));
query.Where.Conditions.Add(DQCondition.And(DQCondition.EQ("IsDeleted", false), DQCondition.EQ("Date", date)));
query.Where.Conditions.Add(DQCondition.And(DQCondition.EQ("IsDeleted", false), DQCondition.EQ("Date", date), DQCondition.IsNotNull(DQExpression.Field("Technics"))));
if (order.HasValue)
query.Where.Conditions.Add(DQCondition.EQ("Order", order));
if (type.HasValue)
query.Where.Conditions.Add(DQCondition.EQ("Technics", type));
query.Columns.Add(DQSelectColumn.Field("Technics"));
query.Columns.Add(DQSelectColumn.Count());
query.Columns.Add(DQSelectColumn.Sum("Weight"));
query.GroupBy.Expressions.Add(DQExpression.Field("Technics"));
var list = new List<Tuple<short, int>>();
var list = new List<Tuple<short, int, decimal>>();
using (var session = LocalDmoSession.New())
{
using (var reader = session.ExecuteReader(query))
{
while (reader.Read())
list.Add(new Tuple<short, int>((short)reader[0], Convert.ToInt32(reader[1])));
{
decimal w = 0;
if (reader[2] != null)
w = Convert.ToDecimal(reader[2]);
list.Add(new Tuple<short, int, decimal>((short)reader[0], Convert.ToInt32(reader[1]), w));
}
}
return list;
}
@ -353,7 +361,7 @@ namespace BO.Utils.BillRpc
}
}
public static List<GradeAndWeight_Detail> GetGradeAndWeightDetails(DateTime date, int? order, int? index)
public static List<GradeAndWeight_Detail> GetGradeAndWeightDetails(DateTime date, int? order, int? index, short? type)
{
var query = new DmoQuery(typeof(GradeAndWeight_Detail));
query.Where.Conditions.Add(DQCondition.And(DQCondition.EQ("IsDeleted", false), DQCondition.EQ("Date", date)));
@ -361,6 +369,8 @@ namespace BO.Utils.BillRpc
query.Where.Conditions.Add(DQCondition.Or(DQCondition.IsNull(DQExpression.Field("Order")), DQCondition.EQ("Order", order)));
if (index.HasValue)
query.Where.Conditions.Add(DQCondition.EQ("Index", index));
if (type.HasValue)
query.Where.Conditions.Add(DQCondition.EQ("Technics", type));
using (var session = LocalDmoSession.New())
{
return session.ExecuteList(query).Cast<GradeAndWeight_Detail>().ToList();
@ -383,7 +393,17 @@ namespace BO.Utils.BillRpc
else
{
entity.Sync = false;
session.Update(entity);
var update = new DQUpdateDom(typeof(GradeAndWeight_Detail));
update.Columns.Add(new DQUpdateColumn("Technics", entity.Technics));
update.Columns.Add(new DQUpdateColumn("Technics_Name", entity.Technics_Name));
update.Columns.Add(new DQUpdateColumn("Index", entity.Index));
update.Columns.Add(new DQUpdateColumn("Order", entity.Order));
update.Columns.Add(new DQUpdateColumn("Sync", entity.Sync));
update.Columns.Add(new DQUpdateColumn("Weight", entity.Weight));
update.Columns.Add(new DQUpdateColumn("Livestock_ID", entity.Livestock_ID));
update.Columns.Add(new DQUpdateColumn("Livestock_ID", entity.Livestock_ID));
update.Where.Conditions.Add(DQCondition.EQ("SID", entity.SID));
session.ExecuteNonQuery(update);
}
session.Commit();
}


+ 211
- 155
WeighAndGrading/DataConfirm.Designer.cs View File

@ -28,15 +28,15 @@
/// </summary>
private void InitializeComponent()
{
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle13 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle14 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle18 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle15 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle16 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle();
this.leftBtn = new System.Windows.Forms.Button();
this.uDatePicker1 = new BWP.WinFormControl.UDatePicker();
this.label1 = new System.Windows.Forms.Label();
@ -48,20 +48,14 @@
this.rightIndex = new BWP.WinFormControl.UTextBoxWithPad();
this.label4 = new System.Windows.Forms.Label();
this.orderGridView = new BWP.WinFormControl.UDataGridView();
this.vScrollBar1 = new System.Windows.Forms.VScrollBar();
this.ttPanel = new System.Windows.Forms.FlowLayoutPanel();
this.mbPanel = new System.Windows.Forms.FlowLayoutPanel();
this.weightGrid = new BWP.WinFormControl.UDataGridView();
this.L_Order = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.L_PlanNumber = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.L_HotFadeNumber = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.L_MaoNumber = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.label5 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.tangNumber = new System.Windows.Forms.Label();
this.maoNumber = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.vScrollBar1 = new System.Windows.Forms.VScrollBar();
this.ttPanel = new System.Windows.Forms.FlowLayoutPanel();
this.mbPanel = new System.Windows.Forms.FlowLayoutPanel();
this.weightGrid = new BWP.WinFormControl.UDataGridView();
this.H_SID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.H_Index = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.H_Order = new System.Windows.Forms.DataGridViewTextBoxColumn();
@ -70,8 +64,18 @@
this.H_Weight = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.H_Time = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.H_Save = new System.Windows.Forms.DataGridViewButtonColumn();
this.label5 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.tangNumber = new System.Windows.Forms.Label();
this.maoNumber = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.AddBtn = new System.Windows.Forms.Button();
this.deleteBtn = new System.Windows.Forms.Button();
this.tangW = new System.Windows.Forms.Label();
this.maoW = new System.Windows.Forms.Label();
this.tangBtn = new System.Windows.Forms.Button();
this.maoBtn = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.orderGridView)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.weightGrid)).BeginInit();
this.SuspendLayout();
@ -79,7 +83,7 @@
// leftBtn
//
this.leftBtn.Font = new System.Drawing.Font("宋体", 15F);
this.leftBtn.Location = new System.Drawing.Point(504, 17);
this.leftBtn.Location = new System.Drawing.Point(527, 17);
this.leftBtn.Name = "leftBtn";
this.leftBtn.Size = new System.Drawing.Size(149, 41);
this.leftBtn.TabIndex = 5;
@ -124,9 +128,9 @@
// leftOrder
//
this.leftOrder.Font = new System.Drawing.Font("宋体", 20F);
this.leftOrder.Location = new System.Drawing.Point(380, 18);
this.leftOrder.Location = new System.Drawing.Point(373, 18);
this.leftOrder.Name = "leftOrder";
this.leftOrder.Size = new System.Drawing.Size(100, 38);
this.leftOrder.Size = new System.Drawing.Size(103, 38);
this.leftOrder.TabIndex = 7;
this.leftOrder.Type = BWP.WinFormControl.UTextBoxWithPad.TextBoxType.Number;
//
@ -185,17 +189,17 @@
this.orderGridView.AllowUserToDeleteRows = false;
this.orderGridView.AllowUserToResizeColumns = false;
this.orderGridView.AllowUserToResizeRows = false;
dataGridViewCellStyle10.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
this.orderGridView.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle10;
dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
this.orderGridView.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
this.orderGridView.BackgroundColor = System.Drawing.Color.White;
dataGridViewCellStyle11.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle11.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle11.Font = new System.Drawing.Font("宋体", 12F);
dataGridViewCellStyle11.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle11.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle11.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle11.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.orderGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle11;
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle2.Font = new System.Drawing.Font("宋体", 12F);
dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.orderGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
this.orderGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.orderGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.L_Order,
@ -207,11 +211,11 @@
this.orderGridView.Name = "orderGridView";
this.orderGridView.ReadOnly = true;
this.orderGridView.RowHeadersVisible = false;
dataGridViewCellStyle12.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle12.ForeColor = System.Drawing.Color.Black;
dataGridViewCellStyle12.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218)))));
dataGridViewCellStyle12.SelectionForeColor = System.Drawing.Color.Black;
this.orderGridView.RowsDefaultCellStyle = dataGridViewCellStyle12;
dataGridViewCellStyle3.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle3.ForeColor = System.Drawing.Color.Black;
dataGridViewCellStyle3.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218)))));
dataGridViewCellStyle3.SelectionForeColor = System.Drawing.Color.Black;
this.orderGridView.RowsDefaultCellStyle = dataGridViewCellStyle3;
this.orderGridView.RowTemplate.Height = 60;
this.orderGridView.ScrollBars = System.Windows.Forms.ScrollBars.None;
this.orderGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
@ -219,11 +223,43 @@
this.orderGridView.TabIndex = 13;
this.orderGridView.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.orderGridView_CellClick);
//
// L_Order
//
this.L_Order.DataPropertyName = "Order";
this.L_Order.HeaderText = "顺序号";
this.L_Order.Name = "L_Order";
this.L_Order.ReadOnly = true;
this.L_Order.Width = 95;
//
// L_PlanNumber
//
this.L_PlanNumber.DataPropertyName = "PlanNumber";
this.L_PlanNumber.HeaderText = "头数";
this.L_PlanNumber.Name = "L_PlanNumber";
this.L_PlanNumber.ReadOnly = true;
this.L_PlanNumber.Width = 90;
//
// L_HotFadeNumber
//
this.L_HotFadeNumber.DataPropertyName = "HotFadeNumber";
this.L_HotFadeNumber.HeaderText = "烫褪";
this.L_HotFadeNumber.Name = "L_HotFadeNumber";
this.L_HotFadeNumber.ReadOnly = true;
this.L_HotFadeNumber.Width = 90;
//
// L_MaoNumber
//
this.L_MaoNumber.DataPropertyName = "MaoNumber";
this.L_MaoNumber.HeaderText = "毛剥";
this.L_MaoNumber.Name = "L_MaoNumber";
this.L_MaoNumber.ReadOnly = true;
this.L_MaoNumber.Width = 90;
//
// vScrollBar1
//
this.vScrollBar1.Location = new System.Drawing.Point(1300, 150);
this.vScrollBar1.Location = new System.Drawing.Point(1300, 185);
this.vScrollBar1.Name = "vScrollBar1";
this.vScrollBar1.Size = new System.Drawing.Size(40, 534);
this.vScrollBar1.Size = new System.Drawing.Size(40, 499);
this.vScrollBar1.TabIndex = 52;
//
// ttPanel
@ -246,17 +282,17 @@
this.weightGrid.AllowUserToDeleteRows = false;
this.weightGrid.AllowUserToResizeColumns = false;
this.weightGrid.AllowUserToResizeRows = false;
dataGridViewCellStyle13.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
this.weightGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle13;
dataGridViewCellStyle4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
this.weightGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle4;
this.weightGrid.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.weightGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle14;
dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle5.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle5.Font = new System.Drawing.Font("宋体", 12F);
dataGridViewCellStyle5.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle5.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle5.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.weightGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle5;
this.weightGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.weightGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.H_SID,
@ -267,59 +303,98 @@
this.H_Weight,
this.H_Time,
this.H_Save});
this.weightGrid.Location = new System.Drawing.Point(740, 150);
this.weightGrid.Location = new System.Drawing.Point(740, 185);
this.weightGrid.MultiSelect = false;
this.weightGrid.Name = "weightGrid";
this.weightGrid.ReadOnly = true;
this.weightGrid.RowHeadersVisible = false;
dataGridViewCellStyle18.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle18.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218)))));
this.weightGrid.RowsDefaultCellStyle = dataGridViewCellStyle18;
dataGridViewCellStyle9.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle9.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218)))));
this.weightGrid.RowsDefaultCellStyle = dataGridViewCellStyle9;
this.weightGrid.RowTemplate.Height = 65;
this.weightGrid.ScrollBars = System.Windows.Forms.ScrollBars.None;
this.weightGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.weightGrid.Size = new System.Drawing.Size(557, 534);
this.weightGrid.Size = new System.Drawing.Size(557, 499);
this.weightGrid.TabIndex = 55;
this.weightGrid.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.weightGrid_CellClick);
this.weightGrid.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.weightGrid_CellContentClick);
//
// L_Order
// H_SID
//
this.L_Order.DataPropertyName = "Order";
this.L_Order.HeaderText = "顺序号";
this.L_Order.Name = "L_Order";
this.L_Order.ReadOnly = true;
this.L_Order.Width = 95;
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;
//
// L_PlanNumber
// H_Index
//
this.L_PlanNumber.DataPropertyName = "PlanNumber";
this.L_PlanNumber.HeaderText = "头数";
this.L_PlanNumber.Name = "L_PlanNumber";
this.L_PlanNumber.ReadOnly = true;
this.L_PlanNumber.Width = 90;
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;
//
// L_HotFadeNumber
// H_Order
//
this.L_HotFadeNumber.DataPropertyName = "HotFadeNumber";
this.L_HotFadeNumber.HeaderText = "烫褪";
this.L_HotFadeNumber.Name = "L_HotFadeNumber";
this.L_HotFadeNumber.ReadOnly = true;
this.L_HotFadeNumber.Width = 90;
this.H_Order.DataPropertyName = "Order";
this.H_Order.HeaderText = "顺序";
this.H_Order.Name = "H_Order";
this.H_Order.ReadOnly = true;
this.H_Order.Width = 65;
//
// L_MaoNumber
// H_Technics
//
this.L_MaoNumber.DataPropertyName = "MaoNumber";
this.L_MaoNumber.HeaderText = "毛剥";
this.L_MaoNumber.Name = "L_MaoNumber";
this.L_MaoNumber.ReadOnly = true;
this.L_MaoNumber.Width = 90;
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";
dataGridViewCellStyle6.Format = "#0.######";
this.H_Weight.DefaultCellStyle = dataGridViewCellStyle6;
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";
dataGridViewCellStyle7.Format = "HH:mm:ss";
dataGridViewCellStyle7.NullValue = null;
this.H_Time.DefaultCellStyle = dataGridViewCellStyle7;
this.H_Time.HeaderText = "时间";
this.H_Time.Name = "H_Time";
this.H_Time.ReadOnly = true;
//
// H_Save
//
dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle8.Padding = new System.Windows.Forms.Padding(5, 10, 5, 10);
this.H_Save.DefaultCellStyle = dataGridViewCellStyle8;
this.H_Save.HeaderText = "保存";
this.H_Save.Name = "H_Save";
this.H_Save.ReadOnly = true;
this.H_Save.Text = "保存";
this.H_Save.UseColumnTextForButtonValue = true;
//
// label5
//
this.label5.AutoSize = true;
this.label5.Font = new System.Drawing.Font("宋体", 15F);
this.label5.Location = new System.Drawing.Point(772, 96);
this.label5.Location = new System.Drawing.Point(755, 76);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(69, 20);
this.label5.TabIndex = 56;
@ -329,7 +404,7 @@
//
this.label6.AutoSize = true;
this.label6.Font = new System.Drawing.Font("宋体", 15F);
this.label6.Location = new System.Drawing.Point(904, 98);
this.label6.Location = new System.Drawing.Point(887, 78);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(69, 20);
this.label6.TabIndex = 57;
@ -340,7 +415,7 @@
this.tangNumber.AutoSize = true;
this.tangNumber.Font = new System.Drawing.Font("宋体", 18F);
this.tangNumber.ForeColor = System.Drawing.Color.Red;
this.tangNumber.Location = new System.Drawing.Point(837, 94);
this.tangNumber.Location = new System.Drawing.Point(820, 74);
this.tangNumber.Name = "tangNumber";
this.tangNumber.Size = new System.Drawing.Size(22, 24);
this.tangNumber.TabIndex = 58;
@ -351,7 +426,7 @@
this.maoNumber.AutoSize = true;
this.maoNumber.Font = new System.Drawing.Font("宋体", 18F);
this.maoNumber.ForeColor = System.Drawing.Color.Red;
this.maoNumber.Location = new System.Drawing.Point(969, 95);
this.maoNumber.Location = new System.Drawing.Point(952, 75);
this.maoNumber.Name = "maoNumber";
this.maoNumber.Size = new System.Drawing.Size(22, 24);
this.maoNumber.TabIndex = 59;
@ -379,81 +454,10 @@
this.label8.TabIndex = 61;
this.label8.Text = "毛剥:";
//
// 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_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_Order
//
this.H_Order.DataPropertyName = "Order";
this.H_Order.HeaderText = "顺序";
this.H_Order.Name = "H_Order";
this.H_Order.ReadOnly = true;
this.H_Order.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";
dataGridViewCellStyle15.Format = "#0.######";
this.H_Weight.DefaultCellStyle = dataGridViewCellStyle15;
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";
dataGridViewCellStyle16.Format = "HH:mm:ss";
dataGridViewCellStyle16.NullValue = null;
this.H_Time.DefaultCellStyle = dataGridViewCellStyle16;
this.H_Time.HeaderText = "时间";
this.H_Time.Name = "H_Time";
this.H_Time.ReadOnly = true;
//
// H_Save
//
dataGridViewCellStyle17.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle17.Padding = new System.Windows.Forms.Padding(5, 10, 5, 10);
this.H_Save.DefaultCellStyle = dataGridViewCellStyle17;
this.H_Save.HeaderText = "保存";
this.H_Save.Name = "H_Save";
this.H_Save.ReadOnly = true;
this.H_Save.Text = "保存";
this.H_Save.UseColumnTextForButtonValue = true;
//
// AddBtn
//
this.AddBtn.Font = new System.Drawing.Font("宋体", 15F);
this.AddBtn.Location = new System.Drawing.Point(1191, 93);
this.AddBtn.Location = new System.Drawing.Point(1191, 73);
this.AddBtn.Name = "AddBtn";
this.AddBtn.Size = new System.Drawing.Size(149, 39);
this.AddBtn.TabIndex = 62;
@ -464,7 +468,7 @@
// deleteBtn
//
this.deleteBtn.Font = new System.Drawing.Font("宋体", 15F);
this.deleteBtn.Location = new System.Drawing.Point(1019, 93);
this.deleteBtn.Location = new System.Drawing.Point(1019, 73);
this.deleteBtn.Name = "deleteBtn";
this.deleteBtn.Size = new System.Drawing.Size(149, 39);
this.deleteBtn.TabIndex = 63;
@ -472,11 +476,59 @@
this.deleteBtn.UseVisualStyleBackColor = true;
this.deleteBtn.Click += new System.EventHandler(this.deleteBtn_Click);
//
// tangW
//
this.tangW.AutoSize = true;
this.tangW.Font = new System.Drawing.Font("宋体", 18F);
this.tangW.ForeColor = System.Drawing.Color.Red;
this.tangW.Location = new System.Drawing.Point(799, 108);
this.tangW.Name = "tangW";
this.tangW.Size = new System.Drawing.Size(22, 24);
this.tangW.TabIndex = 66;
this.tangW.Text = "0";
//
// maoW
//
this.maoW.AutoSize = true;
this.maoW.Font = new System.Drawing.Font("宋体", 18F);
this.maoW.ForeColor = System.Drawing.Color.Red;
this.maoW.Location = new System.Drawing.Point(926, 108);
this.maoW.Name = "maoW";
this.maoW.Size = new System.Drawing.Size(22, 24);
this.maoW.TabIndex = 67;
this.maoW.Text = "0";
//
// tangBtn
//
this.tangBtn.Font = new System.Drawing.Font("宋体", 15F);
this.tangBtn.Location = new System.Drawing.Point(824, 140);
this.tangBtn.Name = "tangBtn";
this.tangBtn.Size = new System.Drawing.Size(149, 39);
this.tangBtn.TabIndex = 68;
this.tangBtn.Text = "烫褪";
this.tangBtn.UseVisualStyleBackColor = true;
this.tangBtn.Click += new System.EventHandler(this.tangBtn_Click);
//
// maoBtn
//
this.maoBtn.Font = new System.Drawing.Font("宋体", 15F);
this.maoBtn.Location = new System.Drawing.Point(1019, 140);
this.maoBtn.Name = "maoBtn";
this.maoBtn.Size = new System.Drawing.Size(149, 39);
this.maoBtn.TabIndex = 69;
this.maoBtn.Text = "毛剥";
this.maoBtn.UseVisualStyleBackColor = true;
this.maoBtn.Click += new System.EventHandler(this.maoBtn_Click);
//
// DataConfirm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1362, 741);
this.Controls.Add(this.maoBtn);
this.Controls.Add(this.tangBtn);
this.Controls.Add(this.maoW);
this.Controls.Add(this.tangW);
this.Controls.Add(this.deleteBtn);
this.Controls.Add(this.AddBtn);
this.Controls.Add(this.label8);
@ -549,5 +601,9 @@
private System.Windows.Forms.DataGridViewButtonColumn H_Save;
private System.Windows.Forms.Button AddBtn;
private System.Windows.Forms.Button deleteBtn;
private System.Windows.Forms.Label tangW;
private System.Windows.Forms.Label maoW;
private System.Windows.Forms.Button tangBtn;
private System.Windows.Forms.Button maoBtn;
}
}

+ 23
- 2
WeighAndGrading/DataConfirm.cs View File

@ -42,6 +42,11 @@ namespace WeighAndGrading
}
private void rightBtn_Click(object sender, EventArgs e)
{
BindWeightGrid(null);
}
void BindWeightGrid(short? type)
{
weightGrid.DataSource = null;
int? order = null;
@ -50,7 +55,7 @@ namespace WeighAndGrading
int? idx = null;
if (!string.IsNullOrEmpty(rightIndex.Text))
idx = int.Parse(rightIndex.Text);
weightList = LocalGradeAndWeightBL.GetGradeAndWeightDetails(uDatePicker1.Date.Value, order, idx);
weightList = LocalGradeAndWeightBL.GetGradeAndWeightDetails(uDatePicker1.Date.Value, order, idx, type);
weightGrid.DataSource = weightList;
InitTangScrollBar();
try
@ -63,15 +68,21 @@ namespace WeighAndGrading
rollIdx = -1;
}
weightGrid.Refresh();
var number = LocalGradeAndWeightBL.GetSumNumber(uDatePicker1.Date.Value, order);
var number = LocalGradeAndWeightBL.GetSumNumber(uDatePicker1.Date.Value, order, null);
var tang = number.FirstOrDefault(x => x.Item1 == 0);
tangNumber.Text = "0";
if (tang != null)
{
tangNumber.Text = tang.Item2.ToString();
tangW.Text = tang.Item3.ToString("#0.######");
}
var mao = number.FirstOrDefault(x => x.Item1 == 1);
maoNumber.Text = "0";
if (mao != null)
{
maoNumber.Text = mao.Item2.ToString();
maoW.Text = mao.Item3.ToString("#0.######");
}
tangNumber.Refresh();
maoNumber.Refresh();
}
@ -211,5 +222,15 @@ namespace WeighAndGrading
weightGrid.FirstDisplayedScrollingRowIndex = rollIdx;
};
}
private void tangBtn_Click(object sender, EventArgs e)
{
BindWeightGrid(0);
}
private void maoBtn_Click(object sender, EventArgs e)
{
BindWeightGrid(1);
}
}
}

Loading…
Cancel
Save