Browse Source

tangtui maobo 修改

master
wugang 8 years ago
parent
commit
7d53d0e85e
13 changed files with 1192 additions and 179 deletions
  1. +5
    -0
      BO/BO/Bill/GradeAndWeight/GradeAndWeight_Detail.cs
  2. +2
    -2
      BO/Utils/BaseInfoRpcUtil.cs
  3. +63
    -1
      BO/Utils/BillRpc/GradeAndWeightRpc.cs
  4. +211
    -0
      WeighAndGrading/AbnormalModifyForm.Designer.cs
  5. +219
    -0
      WeighAndGrading/AbnormalModifyForm.cs
  6. +141
    -0
      WeighAndGrading/AbnormalModifyForm.resx
  7. +2
    -0
      WeighAndGrading/GradeContext.cs
  8. +174
    -107
      WeighAndGrading/GradeFrom.Designer.cs
  9. +320
    -66
      WeighAndGrading/GradeFrom.cs
  10. +3
    -0
      WeighAndGrading/GradeFrom.resx
  11. +29
    -3
      WeighAndGrading/GradeSettingFrom.Designer.cs
  12. +14
    -0
      WeighAndGrading/GradeSettingFrom.cs
  13. +9
    -0
      WeighAndGrading/WeighAndGrading.csproj

+ 5
- 0
BO/BO/Bill/GradeAndWeight/GradeAndWeight_Detail.cs View File

@ -37,6 +37,11 @@ namespace BO.BO.Bill
public DateTime Time { get; set; } public DateTime Time { get; set; }
// public string Shortcut { get; set; }//快捷键
public bool IsLostWeight { get; set; }//是否丢称重
/// <summary> /// <summary>
/// ServerID /// ServerID
/// </summary> /// </summary>


+ 2
- 2
BO/Utils/BaseInfoRpcUtil.cs View File

@ -38,10 +38,10 @@ namespace BO.Utils
return result; return result;
} }
public static List<CTuple<long, string, short>> GetLivestockList()
public static List<CTuple<long, string, short,string>> GetLivestockList()
{ {
var list = RpcFacade.Call<string>("/MainSystem/B3ClientService/Rpcs/BaseInfoRpc/GetLivestock"); var list = RpcFacade.Call<string>("/MainSystem/B3ClientService/Rpcs/BaseInfoRpc/GetLivestock");
return serializer.Deserialize<List<CTuple<long, string, short>>>(list);
return serializer.Deserialize<List<CTuple<long, string, short,string>>>(list);
} }
} }
} }

+ 63
- 1
BO/Utils/BillRpc/GradeAndWeightRpc.cs View File

@ -49,7 +49,7 @@ namespace BO.Utils.BillRpc
{ {
static JavaScriptSerializer serializer = new JavaScriptSerializer(); static JavaScriptSerializer serializer = new JavaScriptSerializer();
class DmoSession
public class DmoSession
{ {
public static IDmoSessionWithTransaction New() public static IDmoSessionWithTransaction New()
{ {
@ -74,6 +74,31 @@ namespace BO.Utils.BillRpc
} }
} }
public static void ClearWeightBySID(long sid)
{
var updateDom = new DQUpdateDom(typeof(GradeAndWeight_Detail));
updateDom.Where.Conditions.Add(DQCondition.EQ("SID", sid));
updateDom.Columns.Add(new DQUpdateColumn("Weight", DQExpression.NULL));
using (var session = DmoSession.New())
{
session.ExecuteNonQuery(updateDom);
session.Commit();
}
}
public static void UpdateLosted(long sid)
{
var updateDom = new DQUpdateDom(typeof(GradeAndWeight_Detail));
updateDom.Where.Conditions.Add(DQCondition.EQ("SID", sid));
updateDom.Columns.Add(new DQUpdateColumn("IsLostWeight", true));
using (var session = DmoSession.New())
{
session.ExecuteNonQuery(updateDom);
session.Commit();
}
}
public static List<GradeAndWeight_Detail> GetDetails(DateTime date, int top = 15) public static List<GradeAndWeight_Detail> GetDetails(DateTime date, int top = 15)
{ {
var query = new DmoQuery(typeof(GradeAndWeight_Detail)); var query = new DmoQuery(typeof(GradeAndWeight_Detail));
@ -86,6 +111,43 @@ namespace BO.Utils.BillRpc
} }
} }
public static int GetTangTuiSumNumber(DateTime date)
{
var query = new DQueryDom(new JoinAlias(typeof(GradeAndWeight_Detail)));
query.Where.Conditions.Add(DQCondition.EQ("Date", date));
query.Where.Conditions.Add(DQCondition.EQ("Technics_Name", "烫褪"));
query.Columns.Add(DQSelectColumn.Count());
using (var session = DmoSession.New())
{
return Convert.ToInt32(session.ExecuteScalar(query));
}
}
public static int GetMaoBoSumNumber(DateTime date)
{
var query = new DQueryDom(new JoinAlias(typeof(GradeAndWeight_Detail)));
query.Where.Conditions.Add(DQCondition.EQ("Date", date));
query.Where.Conditions.Add(DQCondition.EQ("Technics_Name", "毛剥"));
query.Columns.Add(DQSelectColumn.Count());
using (var session = DmoSession.New())
{
return Convert.ToInt32(session.ExecuteScalar(query));
}
}
public static List<GradeAndWeight_Detail> GetLostWeightDetails(DateTime date)
{
var query = new DmoQuery(typeof(GradeAndWeight_Detail));
query.Where.Conditions.Add(DQCondition.EQ("IsLostWeight", true));
query.Where.Conditions.Add(DQCondition.EQ("Date", date));
query.OrderBy.Expressions.Add(DQOrderByExpression.Create("Index", true));
using (var session = DmoSession.New())
{
return session.ExecuteList(query).Cast<GradeAndWeight_Detail>().ToList();
}
}
public static void Insert(GradeAndWeight_Detail detail) public static void Insert(GradeAndWeight_Detail detail)
{ {
using (var session = DmoSession.New()) using (var session = DmoSession.New())


+ 211
- 0
WeighAndGrading/AbnormalModifyForm.Designer.cs View File

@ -0,0 +1,211 @@
namespace WeighAndGrading
{
partial class AbnormalModifyForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
this.panel4 = new System.Windows.Forms.Panel();
this.button1 = new System.Windows.Forms.Button();
this.flpKeyPanel = new System.Windows.Forms.FlowLayoutPanel();
this.uDataGridView1 = new BWP.WinFormControl.UDataGridView();
this.H_SID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.H_Livestock_ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
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.panel4.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.uDataGridView1)).BeginInit();
this.SuspendLayout();
//
// panel4
//
this.panel4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panel4.Controls.Add(this.button1);
this.panel4.Controls.Add(this.flpKeyPanel);
this.panel4.Location = new System.Drawing.Point(504, 13);
this.panel4.Name = "panel4";
this.panel4.Size = new System.Drawing.Size(454, 572);
this.panel4.TabIndex = 61;
//
// button1
//
this.button1.Font = new System.Drawing.Font("宋体", 16F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button1.Location = new System.Drawing.Point(150, 499);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(129, 54);
this.button1.TabIndex = 45;
this.button1.Text = "全部修改";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// flpKeyPanel
//
this.flpKeyPanel.Location = new System.Drawing.Point(3, 22);
this.flpKeyPanel.Name = "flpKeyPanel";
this.flpKeyPanel.Padding = new System.Windows.Forms.Padding(25, 0, 0, 0);
this.flpKeyPanel.Size = new System.Drawing.Size(446, 406);
this.flpKeyPanel.TabIndex = 43;
//
// uDataGridView1
//
this.uDataGridView1.AllowUserToAddRows = false;
this.uDataGridView1.AllowUserToDeleteRows = false;
this.uDataGridView1.AllowUserToResizeColumns = false;
this.uDataGridView1.AllowUserToResizeRows = false;
dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
this.uDataGridView1.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
this.uDataGridView1.BackgroundColor = System.Drawing.Color.White;
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.uDataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
this.uDataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.uDataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.H_SID,
this.H_Livestock_ID,
this.H_Index,
this.H_Technics,
this.H_Livestock_Name,
this.H_Weight,
this.H_Time});
this.uDataGridView1.Location = new System.Drawing.Point(12, 12);
this.uDataGridView1.MultiSelect = false;
this.uDataGridView1.Name = "uDataGridView1";
this.uDataGridView1.ReadOnly = true;
this.uDataGridView1.RowHeadersVisible = false;
dataGridViewCellStyle5.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle5.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218)))));
this.uDataGridView1.RowsDefaultCellStyle = dataGridViewCellStyle5;
this.uDataGridView1.RowTemplate.Height = 40;
this.uDataGridView1.ScrollBars = System.Windows.Forms.ScrollBars.None;
this.uDataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.uDataGridView1.Size = new System.Drawing.Size(423, 566);
this.uDataGridView1.TabIndex = 44;
this.uDataGridView1.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.uDataGridView1_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;
//
// 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";
dataGridViewCellStyle3.Format = "#0.######";
this.H_Weight.DefaultCellStyle = dataGridViewCellStyle3;
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";
dataGridViewCellStyle4.Format = "HH:mm:ss";
dataGridViewCellStyle4.NullValue = null;
this.H_Time.DefaultCellStyle = dataGridViewCellStyle4;
this.H_Time.HeaderText = "时间";
this.H_Time.Name = "H_Time";
this.H_Time.ReadOnly = true;
//
// AbnormalModifyForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(970, 590);
this.Controls.Add(this.uDataGridView1);
this.Controls.Add(this.panel4);
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "AbnormalModifyForm";
this.Text = "异常修改";
this.Load += new System.EventHandler(this.AbnormalModifyForm_Load);
this.panel4.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.uDataGridView1)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Panel panel4;
private System.Windows.Forms.FlowLayoutPanel flpKeyPanel;
private BWP.WinFormControl.UDataGridView uDataGridView1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.DataGridViewTextBoxColumn H_SID;
private System.Windows.Forms.DataGridViewTextBoxColumn H_Livestock_ID;
private System.Windows.Forms.DataGridViewTextBoxColumn H_Index;
private System.Windows.Forms.DataGridViewTextBoxColumn H_Technics;
private System.Windows.Forms.DataGridViewTextBoxColumn H_Livestock_Name;
private System.Windows.Forms.DataGridViewTextBoxColumn H_Weight;
private System.Windows.Forms.DataGridViewTextBoxColumn H_Time;
}
}

+ 219
- 0
WeighAndGrading/AbnormalModifyForm.cs View File

@ -0,0 +1,219 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using BO.BO.Bill;
using BO.Utils.BillRpc;
namespace WeighAndGrading
{
public partial class AbnormalModifyForm : Form
{
List<GradeAndWeight_Detail> details;
private DateTime mDate;
GradeAndWeight_Detail mCurrentSlectItem;
public AbnormalModifyForm(DateTime date)
{
InitializeComponent();
mDate = date;
uDataGridView1.AutoGenerateColumns = false;
}
private void AbnormalModifyForm_Load(object sender, EventArgs e)
{
BindGridView();
AddKeyPad();
if (uDataGridView1.Rows.Count > 0)
{
uDataGridView1.Rows[0].Selected = true;
var currentRow = uDataGridView1.Rows[0].DataBoundItem as GradeAndWeight_Detail;
mCurrentSlectItem = currentRow;
}
}
private void BindGridView()
{
details = LocalGradeAndWeightBL.GetLostWeightDetails(mDate);
if (details.Any())
uDataGridView1.DataSource = details;
}
private void AddKeyPad()
{
for (var i = 1; i < 10; i++)
{
var btn = new Button() { Name = "_3" + i, Text = i.ToString(), Size = new Size(80, 60), TextAlign = ContentAlignment.MiddleCenter, Margin = new Padding { All = 10 }, Font = new Font("宋体", 15) };
btn.Click += (sender, e) =>
{
ModifyWeight(btn.Text);
};
flpKeyPanel.Controls.Add(btn);
}
var zero = new Button() { Name = "_30", Text = "0", Size = new Size(80, 60), TextAlign = ContentAlignment.MiddleCenter, Margin = new Padding { All = 10 }, Font = new Font("宋体", 15) };
zero.Click += (sender, e) =>
{
ModifyWeight(zero.Text);
};
flpKeyPanel.Controls.Add(zero);
var dian = new Button() { Name = "_40", Text = ".", Size = new Size(80, 60), TextAlign = ContentAlignment.MiddleCenter, Margin = new Padding { All = 10 }, Font = new Font("宋体", 15) };
dian.Click += (sender, e) =>
{
ModifyWeight(dian.Text);
};
flpKeyPanel.Controls.Add(dian);
var back = new Button() { Name = "_3back", Text = "←", Size = new Size(80, 60), TextAlign = ContentAlignment.MiddleCenter, Margin = new Padding { All = 10 }, Font = new Font("宋体", 15) };
back.Click += (sender, e) =>
{
ModifyWeight(back.Text);
};
flpKeyPanel.Controls.Add(back);
var clear = new Button() { Name = "_3clear", Text = "清空", Size = new Size(80, 60), TextAlign = ContentAlignment.MiddleCenter, Margin = new Padding { All = 10 }, Font = new Font("宋体", 15) };
clear.Click += (sender, e) =>
{
ModifyWeight(clear.Text);
};
flpKeyPanel.Controls.Add(clear);
}
// private decimal? lastWeght;
private void ModifyWeight(string input)
{
if (mCurrentSlectItem == null)
throw new Exception("请选择一条记录");
var destring = DecimalToString(mCurrentSlectItem.Weight);
var value=GetAfterNumber(destring, input);
mCurrentSlectItem.Weight = StringToDecimal(value);
uDataGridView1.Refresh();
}
decimal? StringToDecimal(string value)
{
if (string.IsNullOrWhiteSpace(value))
{
return null;
}
value = value.Replace("..", ".");
if (value.Length > 1)
{
var last = value.Substring(value.Length - 1);
if (last == ".")
{
value += "0";
}
}
try
{
return decimal.Parse(value);
}
catch
{
return null;
}
}
string DecimalToString(decimal? value)
{
if (value == null)
{
return "";
}
try
{
var newvalue = value.ToString();
if (newvalue.Length > 2)
{
var lasttwo = newvalue.Substring(newvalue.Length - 2);
if (lasttwo == ".0")
{
var intvalue = Convert.ToInt32(value);
return intvalue.ToString() + ".";
}
}
return value.ToString()+"";
}
catch
{
return value.ToString();
}
}
string GetAfterNumber(string oldValue, string input)
{
bool hasValue = !string.IsNullOrWhiteSpace(oldValue);
switch (input)
{
case ".":
if (hasValue)
return (oldValue + ".");
return null;
case "0":
if (hasValue)
return (oldValue + "0");
return null;
case "←":
if (hasValue)
{
var s = oldValue.ToString();
s = s.Substring(0, s.Length - 1);
if (string.IsNullOrEmpty(s))
return null;
return (s);
}
return null;
case "清空":
return null;
default:
var sn = "";
if (hasValue)
sn = oldValue.ToString();
sn += input;
return (sn);
}
}
private void button1_Click(object sender, EventArgs e)
{
foreach (GradeAndWeight_Detail detail in details.Where(x=>x.Weight.HasValue))
{
detail.IsLostWeight = false;
detail.Sync = false;
LocalGradeAndWeightBL.Update(detail, "Weight", "IsLostWeight", "Sync");
}
details = LocalGradeAndWeightBL.GetLostWeightDetails(mDate);
uDataGridView1.Refresh();
MessageBox.Show("保存成功");
DialogResult=DialogResult.OK;
Close();
}
private void uDataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
{
if (e.RowIndex < 0)
return;
var currentRow = uDataGridView1.CurrentRow.DataBoundItem as GradeAndWeight_Detail;
mCurrentSlectItem = currentRow;
}
}
}

+ 141
- 0
WeighAndGrading/AbnormalModifyForm.resx View File

@ -0,0 +1,141 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="H_SID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="H_Livestock_ID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="H_Index.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="H_Technics.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="H_Livestock_Name.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="H_Weight.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="H_Time.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>

+ 2
- 0
WeighAndGrading/GradeContext.cs View File

@ -77,5 +77,7 @@ namespace WeighAndGrading
public decimal MinWeight { get; set; } public decimal MinWeight { get; set; }
public decimal MaxWeight { get; set; } public decimal MaxWeight { get; set; }
public decimal AllowInterval{ get; set; }//当固定值发送数据的时候 设置称 多少秒接受数据
} }
} }

+ 174
- 107
WeighAndGrading/GradeFrom.Designer.cs View File

@ -28,19 +28,19 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle13 = 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 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();
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();
@ -50,7 +50,7 @@
this.groupBox1 = new System.Windows.Forms.GroupBox(); this.groupBox1 = new System.Windows.Forms.GroupBox();
this.tangScrollBar = new System.Windows.Forms.VScrollBar(); this.tangScrollBar = new System.Windows.Forms.VScrollBar();
this.ttPanel = new System.Windows.Forms.FlowLayoutPanel(); this.ttPanel = new System.Windows.Forms.FlowLayoutPanel();
this.label10 = new System.Windows.Forms.Label();
this.lblTangTui = new System.Windows.Forms.Label();
this.tangGridView = new BWP.WinFormControl.UDataGridView(); this.tangGridView = new BWP.WinFormControl.UDataGridView();
this.T_OrderDetail_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.T_OrderDetail_ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.T_Finish = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.T_Finish = new System.Windows.Forms.DataGridViewTextBoxColumn();
@ -67,8 +67,8 @@
this.M_Number = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.M_Number = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.M_Already = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.M_Already = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.M_FinishBtn = new System.Windows.Forms.DataGridViewButtonColumn(); this.M_FinishBtn = new System.Windows.Forms.DataGridViewButtonColumn();
this.label11 = new System.Windows.Forms.Label();
this.mbPanel = new System.Windows.Forms.FlowLayoutPanel(); this.mbPanel = new System.Windows.Forms.FlowLayoutPanel();
this.lblMaoBo = new System.Windows.Forms.Label();
this.groupBox3 = new System.Windows.Forms.GroupBox(); this.groupBox3 = new System.Windows.Forms.GroupBox();
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();
@ -87,14 +87,19 @@
this.discontBtn = new System.Windows.Forms.Button(); this.discontBtn = new System.Windows.Forms.Button();
this.discontPanel = new System.Windows.Forms.FlowLayoutPanel(); this.discontPanel = new System.Windows.Forms.FlowLayoutPanel();
this.statePic = new System.Windows.Forms.PictureBox(); this.statePic = new System.Windows.Forms.PictureBox();
this.btnLockItem = new System.Windows.Forms.Button();
this.btnClearLast = new System.Windows.Forms.Button();
this.btnAbnormalModify = new System.Windows.Forms.Button();
this.H_SID = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.H_SID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.H_Livestock_ID = 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_ReadWeight = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.H_Index = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.H_Index = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.H_Technics = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.H_Technics = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.H_Livestock_Name = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.H_Livestock_Name = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.H_Weight = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.H_Weight = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.H_Time = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.H_Time = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.lblHeJi = 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();
@ -171,11 +176,11 @@
// //
this.groupBox1.Controls.Add(this.tangScrollBar); this.groupBox1.Controls.Add(this.tangScrollBar);
this.groupBox1.Controls.Add(this.ttPanel); this.groupBox1.Controls.Add(this.ttPanel);
this.groupBox1.Controls.Add(this.label10);
this.groupBox1.Controls.Add(this.lblTangTui);
this.groupBox1.Controls.Add(this.tangGridView); this.groupBox1.Controls.Add(this.tangGridView);
this.groupBox1.Location = new System.Drawing.Point(16, 175); this.groupBox1.Location = new System.Drawing.Point(16, 175);
this.groupBox1.Name = "groupBox1"; this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(783, 330);
this.groupBox1.Size = new System.Drawing.Size(783, 318);
this.groupBox1.TabIndex = 9; this.groupBox1.TabIndex = 9;
this.groupBox1.TabStop = false; this.groupBox1.TabStop = false;
this.groupBox1.Text = "烫褪"; this.groupBox1.Text = "烫褪";
@ -194,15 +199,15 @@
this.ttPanel.Size = new System.Drawing.Size(337, 276); this.ttPanel.Size = new System.Drawing.Size(337, 276);
this.ttPanel.TabIndex = 0; this.ttPanel.TabIndex = 0;
// //
// label10
// lblTangTui
// //
this.label10.AutoSize = true;
this.label10.Font = new System.Drawing.Font("宋体", 15F);
this.label10.Location = new System.Drawing.Point(6, -1);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(49, 20);
this.label10.TabIndex = 32;
this.label10.Text = "烫褪";
this.lblTangTui.AutoSize = true;
this.lblTangTui.Font = new System.Drawing.Font("宋体", 15F);
this.lblTangTui.Location = new System.Drawing.Point(6, -1);
this.lblTangTui.Name = "lblTangTui";
this.lblTangTui.Size = new System.Drawing.Size(49, 20);
this.lblTangTui.TabIndex = 32;
this.lblTangTui.Text = "烫褪";
// //
// tangGridView // tangGridView
// //
@ -210,17 +215,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;
dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
this.tangGridView.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
dataGridViewCellStyle14.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
this.tangGridView.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle14;
this.tangGridView.BackgroundColor = System.Drawing.Color.White; this.tangGridView.BackgroundColor = System.Drawing.Color.White;
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.tangGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
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;
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,
@ -234,12 +239,12 @@
this.tangGridView.Name = "tangGridView"; this.tangGridView.Name = "tangGridView";
this.tangGridView.ReadOnly = true; this.tangGridView.ReadOnly = true;
this.tangGridView.RowHeadersVisible = false; this.tangGridView.RowHeadersVisible = false;
dataGridViewCellStyle4.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle4.ForeColor = System.Drawing.Color.Black;
dataGridViewCellStyle4.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218)))));
dataGridViewCellStyle4.SelectionForeColor = System.Drawing.Color.Black;
this.tangGridView.RowsDefaultCellStyle = dataGridViewCellStyle4;
this.tangGridView.RowTemplate.Height = 60;
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;
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;
this.tangGridView.Size = new System.Drawing.Size(363, 275); this.tangGridView.Size = new System.Drawing.Size(363, 275);
@ -288,9 +293,9 @@
// //
// T_FinishBtn // T_FinishBtn
// //
dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle3.Padding = new System.Windows.Forms.Padding(5, 10, 5, 10);
this.T_FinishBtn.DefaultCellStyle = dataGridViewCellStyle3;
dataGridViewCellStyle16.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle16.Padding = new System.Windows.Forms.Padding(5, 10, 5, 10);
this.T_FinishBtn.DefaultCellStyle = dataGridViewCellStyle16;
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;
@ -301,9 +306,8 @@
// //
this.groupBox2.Controls.Add(this.maoScrollBar); this.groupBox2.Controls.Add(this.maoScrollBar);
this.groupBox2.Controls.Add(this.maoGridView); this.groupBox2.Controls.Add(this.maoGridView);
this.groupBox2.Controls.Add(this.label11);
this.groupBox2.Controls.Add(this.mbPanel); this.groupBox2.Controls.Add(this.mbPanel);
this.groupBox2.Location = new System.Drawing.Point(16, 525);
this.groupBox2.Location = new System.Drawing.Point(16, 508);
this.groupBox2.Name = "groupBox2"; this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(783, 330); this.groupBox2.Size = new System.Drawing.Size(783, 330);
this.groupBox2.TabIndex = 10; this.groupBox2.TabIndex = 10;
@ -323,17 +327,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;
dataGridViewCellStyle5.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
this.maoGridView.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle5;
dataGridViewCellStyle18.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
this.maoGridView.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle18;
this.maoGridView.BackgroundColor = System.Drawing.Color.White; this.maoGridView.BackgroundColor = System.Drawing.Color.White;
dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle6.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle6.Font = new System.Drawing.Font("宋体", 12F);
dataGridViewCellStyle6.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle6.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle6.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.maoGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle6;
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;
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,
@ -347,12 +351,12 @@
this.maoGridView.Name = "maoGridView"; this.maoGridView.Name = "maoGridView";
this.maoGridView.ReadOnly = true; this.maoGridView.ReadOnly = true;
this.maoGridView.RowHeadersVisible = false; this.maoGridView.RowHeadersVisible = false;
dataGridViewCellStyle8.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle8.ForeColor = System.Drawing.Color.Black;
dataGridViewCellStyle8.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218)))));
dataGridViewCellStyle8.SelectionForeColor = System.Drawing.Color.Black;
this.maoGridView.RowsDefaultCellStyle = dataGridViewCellStyle8;
this.maoGridView.RowTemplate.Height = 60;
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;
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;
this.maoGridView.Size = new System.Drawing.Size(363, 278); this.maoGridView.Size = new System.Drawing.Size(363, 278);
@ -401,25 +405,15 @@
// //
// M_FinishBtn // M_FinishBtn
// //
dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle7.Padding = new System.Windows.Forms.Padding(5, 10, 5, 10);
this.M_FinishBtn.DefaultCellStyle = dataGridViewCellStyle7;
dataGridViewCellStyle20.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle20.Padding = new System.Windows.Forms.Padding(5, 10, 5, 10);
this.M_FinishBtn.DefaultCellStyle = dataGridViewCellStyle20;
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;
this.M_FinishBtn.Text = "完毕"; this.M_FinishBtn.Text = "完毕";
this.M_FinishBtn.UseColumnTextForButtonValue = true; this.M_FinishBtn.UseColumnTextForButtonValue = true;
// //
// label11
//
this.label11.AutoSize = true;
this.label11.Font = new System.Drawing.Font("宋体", 15F);
this.label11.Location = new System.Drawing.Point(6, -1);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(49, 20);
this.label11.TabIndex = 32;
this.label11.Text = "毛剥";
//
// mbPanel // mbPanel
// //
this.mbPanel.Location = new System.Drawing.Point(431, 35); this.mbPanel.Location = new System.Drawing.Point(431, 35);
@ -427,14 +421,25 @@
this.mbPanel.Size = new System.Drawing.Size(337, 278); this.mbPanel.Size = new System.Drawing.Size(337, 278);
this.mbPanel.TabIndex = 1; this.mbPanel.TabIndex = 1;
// //
// lblMaoBo
//
this.lblMaoBo.AutoSize = true;
this.lblMaoBo.Font = new System.Drawing.Font("宋体", 15F);
this.lblMaoBo.Location = new System.Drawing.Point(22, 507);
this.lblMaoBo.Name = "lblMaoBo";
this.lblMaoBo.Size = new System.Drawing.Size(49, 20);
this.lblMaoBo.TabIndex = 32;
this.lblMaoBo.Text = "毛剥";
//
// groupBox3 // groupBox3
// //
this.groupBox3.Controls.Add(this.lblHeJi);
this.groupBox3.Controls.Add(this.vScrollBar2); this.groupBox3.Controls.Add(this.vScrollBar2);
this.groupBox3.Controls.Add(this.label12); this.groupBox3.Controls.Add(this.label12);
this.groupBox3.Controls.Add(this.historyGrid); this.groupBox3.Controls.Add(this.historyGrid);
this.groupBox3.Location = new System.Drawing.Point(826, 175); this.groupBox3.Location = new System.Drawing.Point(826, 175);
this.groupBox3.Name = "groupBox3"; this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(471, 680);
this.groupBox3.Size = new System.Drawing.Size(471, 663);
this.groupBox3.TabIndex = 11; this.groupBox3.TabIndex = 11;
this.groupBox3.TabStop = false; this.groupBox3.TabStop = false;
this.groupBox3.Text = "记录"; this.groupBox3.Text = "记录";
@ -462,21 +467,22 @@
this.historyGrid.AllowUserToDeleteRows = false; this.historyGrid.AllowUserToDeleteRows = false;
this.historyGrid.AllowUserToResizeColumns = false; this.historyGrid.AllowUserToResizeColumns = false;
this.historyGrid.AllowUserToResizeRows = false; this.historyGrid.AllowUserToResizeRows = false;
dataGridViewCellStyle9.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
this.historyGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle9;
dataGridViewCellStyle22.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
this.historyGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle22;
this.historyGrid.BackgroundColor = System.Drawing.Color.White; this.historyGrid.BackgroundColor = System.Drawing.Color.White;
dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle10.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle10.Font = new System.Drawing.Font("宋体", 12F);
dataGridViewCellStyle10.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle10.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle10.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle10.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.historyGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle10;
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;
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,
this.H_Livestock_ID, this.H_Livestock_ID,
this.IsLostWeight,
this.H_ReadWeight, this.H_ReadWeight,
this.H_Index, this.H_Index,
this.H_Technics, this.H_Technics,
@ -488,9 +494,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;
dataGridViewCellStyle13.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle13.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218)))));
this.historyGrid.RowsDefaultCellStyle = dataGridViewCellStyle13;
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;
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;
@ -571,9 +577,9 @@
// 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(1270, 12);
this.closeBtn.Location = new System.Drawing.Point(1272, 20);
this.closeBtn.Name = "closeBtn"; this.closeBtn.Name = "closeBtn";
this.closeBtn.Size = new System.Drawing.Size(102, 43);
this.closeBtn.Size = new System.Drawing.Size(102, 60);
this.closeBtn.TabIndex = 33; this.closeBtn.TabIndex = 33;
this.closeBtn.Text = "关闭"; this.closeBtn.Text = "关闭";
this.closeBtn.UseVisualStyleBackColor = true; this.closeBtn.UseVisualStyleBackColor = true;
@ -582,9 +588,9 @@
// configBtn // configBtn
// //
this.configBtn.Font = new System.Drawing.Font("宋体", 15F); this.configBtn.Font = new System.Drawing.Font("宋体", 15F);
this.configBtn.Location = new System.Drawing.Point(1024, 12);
this.configBtn.Location = new System.Drawing.Point(417, 38);
this.configBtn.Name = "configBtn"; this.configBtn.Name = "configBtn";
this.configBtn.Size = new System.Drawing.Size(102, 43);
this.configBtn.Size = new System.Drawing.Size(102, 42);
this.configBtn.TabIndex = 34; this.configBtn.TabIndex = 34;
this.configBtn.Text = "称设置"; this.configBtn.Text = "称设置";
this.configBtn.UseVisualStyleBackColor = true; this.configBtn.UseVisualStyleBackColor = true;
@ -605,9 +611,9 @@
// //
this.modifyPanel.Controls.Add(this.cancelBtn); this.modifyPanel.Controls.Add(this.cancelBtn);
this.modifyPanel.Controls.Add(this.stateLabel); this.modifyPanel.Controls.Add(this.stateLabel);
this.modifyPanel.Location = new System.Drawing.Point(826, 107);
this.modifyPanel.Location = new System.Drawing.Point(826, 112);
this.modifyPanel.Name = "modifyPanel"; this.modifyPanel.Name = "modifyPanel";
this.modifyPanel.Size = new System.Drawing.Size(438, 56);
this.modifyPanel.Size = new System.Drawing.Size(438, 57);
this.modifyPanel.TabIndex = 36; this.modifyPanel.TabIndex = 36;
this.modifyPanel.Visible = false; this.modifyPanel.Visible = false;
// //
@ -626,9 +632,9 @@
// discontBtn // discontBtn
// //
this.discontBtn.Font = new System.Drawing.Font("宋体", 15F); this.discontBtn.Font = new System.Drawing.Font("宋体", 15F);
this.discontBtn.Location = new System.Drawing.Point(1148, 12);
this.discontBtn.Location = new System.Drawing.Point(541, 38);
this.discontBtn.Name = "discontBtn"; this.discontBtn.Name = "discontBtn";
this.discontBtn.Size = new System.Drawing.Size(102, 43);
this.discontBtn.Size = new System.Drawing.Size(102, 42);
this.discontBtn.TabIndex = 37; this.discontBtn.TabIndex = 37;
this.discontBtn.Text = "扣重项"; this.discontBtn.Text = "扣重项";
this.discontBtn.UseVisualStyleBackColor = true; this.discontBtn.UseVisualStyleBackColor = true;
@ -651,6 +657,39 @@
this.statePic.TabIndex = 38; this.statePic.TabIndex = 38;
this.statePic.TabStop = false; this.statePic.TabStop = false;
// //
// btnLockItem
//
this.btnLockItem.Font = new System.Drawing.Font("宋体", 15F);
this.btnLockItem.Location = new System.Drawing.Point(903, 20);
this.btnLockItem.Name = "btnLockItem";
this.btnLockItem.Size = new System.Drawing.Size(102, 60);
this.btnLockItem.TabIndex = 34;
this.btnLockItem.Text = "锁定";
this.btnLockItem.UseVisualStyleBackColor = true;
this.btnLockItem.Click += new System.EventHandler(this.btnLockItem_Click);
//
// btnClearLast
//
this.btnClearLast.Font = new System.Drawing.Font("宋体", 15F);
this.btnClearLast.Location = new System.Drawing.Point(1027, 20);
this.btnClearLast.Name = "btnClearLast";
this.btnClearLast.Size = new System.Drawing.Size(102, 60);
this.btnClearLast.TabIndex = 34;
this.btnClearLast.Text = "清空";
this.btnClearLast.UseVisualStyleBackColor = true;
this.btnClearLast.Click += new System.EventHandler(this.btnClearLast_Click);
//
// btnAbnormalModify
//
this.btnAbnormalModify.Font = new System.Drawing.Font("宋体", 15F);
this.btnAbnormalModify.Location = new System.Drawing.Point(1149, 20);
this.btnAbnormalModify.Name = "btnAbnormalModify";
this.btnAbnormalModify.Size = new System.Drawing.Size(102, 60);
this.btnAbnormalModify.TabIndex = 34;
this.btnAbnormalModify.Text = "异常";
this.btnAbnormalModify.UseVisualStyleBackColor = true;
this.btnAbnormalModify.Click += new System.EventHandler(this.btnAbnormalModify_Click);
//
// H_SID // H_SID
// //
this.H_SID.DataPropertyName = "SID"; this.H_SID.DataPropertyName = "SID";
@ -666,6 +705,14 @@
this.H_Livestock_ID.ReadOnly = true; this.H_Livestock_ID.ReadOnly = true;
this.H_Livestock_ID.Visible = false; 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 // H_ReadWeight
// //
this.H_ReadWeight.DataPropertyName = "ReadWeight"; this.H_ReadWeight.DataPropertyName = "ReadWeight";
@ -701,8 +748,8 @@
// H_Weight // H_Weight
// //
this.H_Weight.DataPropertyName = "Weight"; this.H_Weight.DataPropertyName = "Weight";
dataGridViewCellStyle11.Format = "#0.######";
this.H_Weight.DefaultCellStyle = dataGridViewCellStyle11;
dataGridViewCellStyle24.Format = "#0.######";
this.H_Weight.DefaultCellStyle = dataGridViewCellStyle24;
this.H_Weight.HeaderText = "重量"; this.H_Weight.HeaderText = "重量";
this.H_Weight.Name = "H_Weight"; this.H_Weight.Name = "H_Weight";
this.H_Weight.ReadOnly = true; this.H_Weight.ReadOnly = true;
@ -711,22 +758,36 @@
// H_Time // H_Time
// //
this.H_Time.DataPropertyName = "Time"; this.H_Time.DataPropertyName = "Time";
dataGridViewCellStyle12.Format = "MM/dd HH:mm";
dataGridViewCellStyle12.NullValue = null;
this.H_Time.DefaultCellStyle = dataGridViewCellStyle12;
dataGridViewCellStyle25.Format = "HH:mm:ss";
dataGridViewCellStyle25.NullValue = null;
this.H_Time.DefaultCellStyle = dataGridViewCellStyle25;
this.H_Time.HeaderText = "时间"; this.H_Time.HeaderText = "时间";
this.H_Time.Name = "H_Time"; this.H_Time.Name = "H_Time";
this.H_Time.ReadOnly = true; 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 = "合计:";
//
// 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, 865);
this.ClientSize = new System.Drawing.Size(1379, 842);
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.discontBtn); this.Controls.Add(this.discontBtn);
this.Controls.Add(this.modifyPanel); this.Controls.Add(this.modifyPanel);
this.Controls.Add(this.btnAbnormalModify);
this.Controls.Add(this.btnClearLast);
this.Controls.Add(this.btnLockItem);
this.Controls.Add(this.configBtn); this.Controls.Add(this.configBtn);
this.Controls.Add(this.closeBtn); this.Controls.Add(this.closeBtn);
this.Controls.Add(this.enableWeight); this.Controls.Add(this.enableWeight);
@ -744,16 +805,17 @@
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();
this.groupBox2.ResumeLayout(false); this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.maoGridView)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.maoGridView)).EndInit();
this.groupBox3.ResumeLayout(false); this.groupBox3.ResumeLayout(false);
this.groupBox3.PerformLayout(); this.groupBox3.PerformLayout();
@ -788,10 +850,10 @@
private System.Windows.Forms.Button printBtn; private System.Windows.Forms.Button printBtn;
private System.Windows.Forms.Panel panel1; private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Label lblChengZhong; private System.Windows.Forms.Label lblChengZhong;
private System.Windows.Forms.Label label11;
private System.Windows.Forms.Label lblMaoBo;
private System.Windows.Forms.Label label12; private System.Windows.Forms.Label label12;
private BWP.WinFormControl.UDataGridView historyGrid; private BWP.WinFormControl.UDataGridView historyGrid;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.Label lblTangTui;
private System.Windows.Forms.Button closeBtn; private System.Windows.Forms.Button closeBtn;
private System.Windows.Forms.Button configBtn; private System.Windows.Forms.Button configBtn;
private System.Windows.Forms.Label stateLabel; private System.Windows.Forms.Label stateLabel;
@ -803,6 +865,10 @@
private System.Windows.Forms.VScrollBar tangScrollBar; private System.Windows.Forms.VScrollBar tangScrollBar;
private System.Windows.Forms.VScrollBar maoScrollBar; private System.Windows.Forms.VScrollBar maoScrollBar;
private BWP.WinFormControl.UDataGridView maoGridView; private BWP.WinFormControl.UDataGridView maoGridView;
private System.Windows.Forms.PictureBox statePic;
private System.Windows.Forms.Button btnLockItem;
private System.Windows.Forms.Button btnClearLast;
private System.Windows.Forms.Button btnAbnormalModify;
private System.Windows.Forms.DataGridViewTextBoxColumn T_OrderDetail_ID; private System.Windows.Forms.DataGridViewTextBoxColumn T_OrderDetail_ID;
private System.Windows.Forms.DataGridViewTextBoxColumn T_Finish; private System.Windows.Forms.DataGridViewTextBoxColumn T_Finish;
private System.Windows.Forms.DataGridViewTextBoxColumn T_Order; private System.Windows.Forms.DataGridViewTextBoxColumn T_Order;
@ -815,14 +881,15 @@
private System.Windows.Forms.DataGridViewTextBoxColumn M_Number; private System.Windows.Forms.DataGridViewTextBoxColumn M_Number;
private System.Windows.Forms.DataGridViewTextBoxColumn M_Already; private System.Windows.Forms.DataGridViewTextBoxColumn M_Already;
private System.Windows.Forms.DataGridViewButtonColumn M_FinishBtn; private System.Windows.Forms.DataGridViewButtonColumn M_FinishBtn;
private System.Windows.Forms.PictureBox statePic;
private System.Windows.Forms.DataGridViewTextBoxColumn H_SID; private System.Windows.Forms.DataGridViewTextBoxColumn H_SID;
private System.Windows.Forms.DataGridViewTextBoxColumn H_Livestock_ID; private System.Windows.Forms.DataGridViewTextBoxColumn H_Livestock_ID;
private System.Windows.Forms.DataGridViewTextBoxColumn IsLostWeight;
private System.Windows.Forms.DataGridViewCheckBoxColumn H_ReadWeight; private System.Windows.Forms.DataGridViewCheckBoxColumn H_ReadWeight;
private System.Windows.Forms.DataGridViewTextBoxColumn H_Index; private System.Windows.Forms.DataGridViewTextBoxColumn H_Index;
private System.Windows.Forms.DataGridViewTextBoxColumn H_Technics; private System.Windows.Forms.DataGridViewTextBoxColumn H_Technics;
private System.Windows.Forms.DataGridViewTextBoxColumn H_Livestock_Name; private System.Windows.Forms.DataGridViewTextBoxColumn H_Livestock_Name;
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;
} }
} }

+ 320
- 66
WeighAndGrading/GradeFrom.cs View File

@ -97,9 +97,57 @@ 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);
}
}
}
//点击 级别
void JiBieButtonClick(Button btn)
{
if (details == null)
{
MessageBox.Show("请先同步数据");
return;
}
var livestockTag = btn.Tag as CTuple<long, string, short, string>;
if (modifyDetail == null)
AddDetail(livestockTag);
else
{
modifyDetail.Livestock_ID = livestockTag.Item1;
modifyDetail.Livestock_Name = livestockTag.Item2;
modifyDetail.Technics = livestockTag.Item3;
modifyDetail.Technics_Name = livestockTag.Item3 == TANG_TECH ? "烫褪" : "毛剥";
LocalGradeAndWeightBL.Update(modifyDetail, "Livestock_ID", "Livestock_Name", "Technics", "Technics_Name");
historyGrid.Refresh();
modifyDetail = null;
modifyPanel.Hide();
}
}
void AddLivestockBtn() void AddLivestockBtn()
{ {
var livestocks = new List<CTuple<long, string, short>>();
var livestocks = new List<CTuple<long, string, short, string>>();
var fileName = Path.Combine(DATA_PATH, "Livestocks.xml"); var fileName = Path.Combine(DATA_PATH, "Livestocks.xml");
if (connection) if (connection)
{ {
@ -107,44 +155,91 @@ namespace WeighAndGrading
XmlUtil.SerializerObjToFile(livestocks, fileName); XmlUtil.SerializerObjToFile(livestocks, fileName);
} }
else else
livestocks = XmlUtil.DeserializeFromFile<List<CTuple<long, string, short>>>(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, 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 + "(" + item.Item4.ToLower() + ")", 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) =>
{ {
if (details == null)
{
MessageBox.Show("请先同步数据");
return;
}
var livestockTag = btn.Tag as CTuple<long, string, short>;
if (modifyDetail == null)
AddDetail(livestockTag);
else
{
modifyDetail.Livestock_ID = livestockTag.Item1;
modifyDetail.Livestock_Name = livestockTag.Item2;
modifyDetail.Technics = livestockTag.Item3;
modifyDetail.Technics_Name = livestockTag.Item3 == TANG_TECH ? "烫褪" : "毛剥";
LocalGradeAndWeightBL.Update(modifyDetail, "Livestock_ID", "Livestock_Name", "Technics", "Technics_Name");
historyGrid.Refresh();
modifyDetail = null;
modifyPanel.Hide();
}
JiBieButtonClick(btn);
#region 改到方法JiBieButtonClick()里了
// if (details == null)
// {
// MessageBox.Show("请先同步数据");
// return;
// }
// var livestockTag = btn.Tag as CTuple<long, string, short>;
// if (modifyDetail == null)
// AddDetail(livestockTag);
// else
// {
// modifyDetail.Livestock_ID = livestockTag.Item1;
// modifyDetail.Livestock_Name = livestockTag.Item2;
// modifyDetail.Technics = livestockTag.Item3;
// modifyDetail.Technics_Name = livestockTag.Item3 == TANG_TECH ? "烫褪" : "毛剥";
// LocalGradeAndWeightBL.Update(modifyDetail, "Livestock_ID", "Livestock_Name", "Technics", "Technics_Name");
// historyGrid.Refresh();
// modifyDetail = null;
// modifyPanel.Hide();
// }
#endregion
//var name = livestock.Technics == 0 ? "带皮白条" : "去皮白条"; //var name = livestock.Technics == 0 ? "带皮白条" : "去皮白条";
//Print(name, entity.Index); //Print(name, entity.Index);
}; };
if (item.Item3 == TANG_TECH) if (item.Item3 == TANG_TECH)
{
btn.Click += delegate { SetJiBieSelectBackColor(btn.Text); };
ttPanel.Controls.Add(btn); ttPanel.Controls.Add(btn);
}
else else
{
btn.Click += delegate { SetJiBieSelectBackColor(btn.Text); };
mbPanel.Controls.Add(btn); mbPanel.Controls.Add(btn);
}
} }
SetMargin(ttPanel); SetMargin(ttPanel);
SetMargin(mbPanel); SetMargin(mbPanel);
} }
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)
{ {
for (var i = 0; i < panel.Controls.Count; i++) for (var i = 0; i < panel.Controls.Count; i++)
@ -190,7 +285,7 @@ namespace WeighAndGrading
{ {
while (true) while (true)
{ {
this.Invoke(new InvokeHandler(delegate()
this.Invoke(new InvokeHandler(delegate ()
{ {
BindTangGrid(); BindTangGrid();
BindMaoGrid(); BindMaoGrid();
@ -219,6 +314,8 @@ namespace WeighAndGrading
else else
noLivestockList.Enqueue(bottom); noLivestockList.Enqueue(bottom);
} }
} }
void BindTangGrid() void BindTangGrid()
@ -269,6 +366,7 @@ namespace WeighAndGrading
tangRoll = -1; tangRoll = -1;
} }
tangGridView.Refresh(); tangGridView.Refresh();
lblTangTui.Text= "烫褪" + "("+tangList.Sum(x=>x.Number)+")";
} }
void BindMaoGrid() void BindMaoGrid()
@ -319,6 +417,7 @@ namespace WeighAndGrading
maoRoll = -1; maoRoll = -1;
} }
maoGridView.Refresh(); maoGridView.Refresh();
lblMaoBo.Text = "毛剥" + "(" + maoList.Sum(x=>x.Number) + ")";
} }
void BindDetailGrid() void BindDetailGrid()
@ -348,6 +447,8 @@ namespace WeighAndGrading
rightRoll = -1; rightRoll = -1;
} }
historyGrid.Refresh(); historyGrid.Refresh();
SetHistorBackColor();
ReSetHistorySum();
} }
private void printBtn_Click(object sender, EventArgs e) private void printBtn_Click(object sender, EventArgs e)
@ -429,6 +530,8 @@ namespace WeighAndGrading
string format = "{0:0.00}"; string format = "{0:0.00}";
private DateTime lastWeightDateTime = DateTime.Now;
private void InQuery() private void InQuery()
{ {
while (_mainProcessIsRun) while (_mainProcessIsRun)
@ -458,25 +561,37 @@ namespace WeighAndGrading
string str; string str;
if (_dataFormat.ParseAscii(_dataStrBuilder.ToString(), out str, out isStatic)) if (_dataFormat.ParseAscii(_dataStrBuilder.ToString(), out str, out isStatic))
{ {
//稳定后发送
if (GradeContext.Config.WeightType == 0) if (GradeContext.Config.WeightType == 0)
{ {
if (string.IsNullOrEmpty(str)) if (string.IsNullOrEmpty(str))
str = "0"; str = "0";
this.Invoke(new InvokeHandler(delegate()
this.Invoke(new InvokeHandler(delegate ()
{ {
lblChengZhong.Text = string.Format(format, decimal.Parse(str)); lblChengZhong.Text = string.Format(format, decimal.Parse(str));
if (str != "0") if (str != "0")
{ {
AddWeightDetail(decimal.Parse(lblChengZhong.Text));
//稳定发送有效间隔
var allowInterval = GradeContext.Config.AllowInterval;
//如果间隔时间内多条的话不处理
var timeSpanTotalSeconds= (DateTime.Now - lastWeightDateTime).TotalSeconds;
if (Convert.ToDecimal(timeSpanTotalSeconds) > allowInterval)
{
AddWeightDetail(decimal.Parse(lblChengZhong.Text));
lastWeightDateTime = DateTime.Now;
}
} }
})); }));
} }
//连续发送
else else
{ {
decimal num = 0; decimal num = 0;
if (decimal.TryParse(str, out num)) if (decimal.TryParse(str, out num))
{ {
this.Invoke(new InvokeHandler(delegate()
this.Invoke(new InvokeHandler(delegate ()
{ {
lblChengZhong.Text = string.Format(format, num); lblChengZhong.Text = string.Format(format, num);
})); }));
@ -485,11 +600,12 @@ namespace WeighAndGrading
} }
if (WeighAvgControl.TryGetValue(out num)) if (WeighAvgControl.TryGetValue(out num))
{ {
this.Invoke(new InvokeHandler(delegate()
this.Invoke(new InvokeHandler(delegate ()
{ {
//lblChengZhong.Text = string.Format(format, num); //lblChengZhong.Text = string.Format(format, num);
if (str != "0") if (str != "0")
{ {
//
AddWeightDetail(decimal.Parse(string.Format(format, num))); AddWeightDetail(decimal.Parse(string.Format(format, num)));
} }
})); }));
@ -583,7 +699,7 @@ namespace WeighAndGrading
static object _obj = new object(); static object _obj = new object();
void AddDetail(CTuple<long, string, short> livestock)
void AddDetail(CTuple<long, string, short, string> livestock)
{ {
lock (_obj) lock (_obj)
{ {
@ -649,9 +765,20 @@ namespace WeighAndGrading
orderLabel.Text = string.Empty; orderLabel.Text = string.Empty;
alreadyLabel.Text = string.Empty; alreadyLabel.Text = string.Empty;
} }
//计算合计
ReSetHistorySum();
} }
} }
void ReSetHistorySum()
{
var tangtui=LocalGradeAndWeightBL.GetTangTuiSumNumber(butcherTimeInput.Date.Value);
var maobo=LocalGradeAndWeightBL.GetMaoBoSumNumber(butcherTimeInput.Date.Value);
lblHeJi.Text = "合计: 烫褪("+ tangtui + ") 毛剥("+maobo+")";
}
void AddWeightDetail(decimal weight) void AddWeightDetail(decimal weight)
{ {
lock (_obj) lock (_obj)
@ -670,18 +797,21 @@ namespace WeighAndGrading
} }
else//add else//add
{ {
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();
//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();
} }
} }
} }
@ -692,45 +822,156 @@ namespace WeighAndGrading
modifyPanel.Hide(); modifyPanel.Hide();
} }
GradeAndWeight_Detail lastCheckItem;
long? lastSelectID = null;
private void historyGrid_CellClick(object sender, DataGridViewCellEventArgs e)
private void btnClearLast_Click(object sender, EventArgs e)
{ {
if (e.RowIndex < 0)
return;
var currentRow = historyGrid.CurrentRow.DataBoundItem as GradeAndWeight_Detail;
lastSelectID = currentRow.SID;
if (e.ColumnIndex == 2)
// if (MessageBox.Show("确定清空最后一次称重?", "确定清空最后一次称重?", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
// {
// return;
// }
// if (mCurrentSlectItem == null)
// {
// return;
// }
//有称重重量的 并且不是掉猪的最大的一条
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)
{ {
if (lastCheckItem != null && lastCheckItem.SID != currentRow.SID)
lastCheckItem.ReadWeight = false;
lastCheckItem = currentRow;
lastCheckItem.ReadWeight = !lastCheckItem.ReadWeight;
if (item.SID >= fd.SID)
{
stack.Push(item);
}
}
while (stack.Count > 0)
noWeightList.Enqueue(stack.Pop());
}
modifyDetail = null;
private void btnLockItem_Click(object sender, EventArgs e)
{
if (mCurrentSlectItem == null)
{
return;
}
//获取最大值
var lostList = details.Where(x => x.IsLostWeight).ToList();
if (lostList.Count < 1)
{
maxLockID = 0;
}
else
{
maxLockID = lostList.Max(x => x.SID);
}
//赋最大值
if (mCurrentSlectItem.SID > maxLockID)
{
maxLockID = mCurrentSlectItem.SID;
UpdateItemLosted(mCurrentSlectItem.SID);
if (modifyPanel.Visible) if (modifyPanel.Visible)
modifyPanel.Hide(); modifyPanel.Hide();
historyGrid.Refresh(); historyGrid.Refresh();
if (lastCheckItem.ReadWeight)
noWeightList = new ConcurrentQueue<GradeAndWeight_Detail>();
var stack = new Stack<GradeAndWeight_Detail>();
foreach (var item in details)
{ {
noWeightList = new ConcurrentQueue<GradeAndWeight_Detail>();
var stack = new Stack<GradeAndWeight_Detail>();
foreach (var item in details)
if (item.SID > mCurrentSlectItem.SID)
{ {
stack.Push(item); stack.Push(item);
if (item.SID == lastCheckItem.SID)
break;
} }
while (stack.Count > 0)
noWeightList.Enqueue(stack.Pop());
} }
else
while (stack.Count > 0)
{ {
FillQueue();
lastCheckItem = null;
noWeightList.Enqueue(stack.Pop());
} }
return;
}
SetHistorBackColor();
}
void SetHistorBackColor()
{
foreach (DataGridViewRow row in historyGrid.Rows)
{
if ((bool)row.Cells["IsLostWeight"].Value)
row.DefaultCellStyle.BackColor = Color.Red;
} }
}
private void UpdateItemLosted(long sid)
{
//设置数据库
LocalGradeAndWeightBL.UpdateLosted(sid);
//更新界面
var fd = details.First(x => x.SID == sid);
fd.IsLostWeight = true;
}
private long? maxLockID;
GradeAndWeight_Detail lastCheckItem, mCurrentSlectItem;
long? lastSelectID = null;
private void historyGrid_CellClick(object sender, DataGridViewCellEventArgs e)
{
if (e.RowIndex < 0)
return;
var currentRow = historyGrid.CurrentRow.DataBoundItem as GradeAndWeight_Detail;
lastSelectID = currentRow.SID;
mCurrentSlectItem = currentRow;
if (e.ColumnIndex == 3)
{
if (lastCheckItem != null && lastCheckItem.SID != currentRow.SID)
lastCheckItem.ReadWeight = false;
lastCheckItem = currentRow;
lastCheckItem.ReadWeight = !lastCheckItem.ReadWeight;
//
modifyDetail = null;
if (modifyPanel.Visible)
modifyPanel.Hide();
historyGrid.Refresh();
// if (lastCheckItem.ReadWeight)
// {
// noWeightList = new ConcurrentQueue<GradeAndWeight_Detail>();
// var stack = new Stack<GradeAndWeight_Detail>();
// foreach (var item in details)
// {
// if (item.SID > lastCheckItem.SID)
// {
// stack.Push(item);
// }
//// stack.Push(item);
//// if (item.SID == lastCheckItem.SID)
//// break;
// }
// while (stack.Count > 0)
// noWeightList.Enqueue(stack.Pop());
// }
// else
// {
// FillQueue();
// lastCheckItem = null;
// }
return;
}
modifyDetail = currentRow; modifyDetail = currentRow;
stateLabel.Text = string.Format("您正在修改序号为 {0} 的信息", modifyDetail.Index); stateLabel.Text = string.Format("您正在修改序号为 {0} 的信息", modifyDetail.Index);
modifyPanel.Show(); modifyPanel.Show();
@ -1003,17 +1244,30 @@ namespace WeighAndGrading
last = connection; last = connection;
} }
private void btnAbnormalModify_Click(object sender, EventArgs e)
{
if (!butcherTimeInput.Date.HasValue)
{
MessageBox.Show("请在上一个界面选择宰杀日期");
return;
}
var f=new AbnormalModifyForm(butcherTimeInput.Date.Value);
f.ShowDialog();
}
private void GradeFrom_Load(object sender, EventArgs e) private void GradeFrom_Load(object sender, EventArgs e)
{ {
syncToServer = new Thread(ToServerTask); syncToServer = new Thread(ToServerTask);
syncToServer.Start(); syncToServer.Start();
} }
void ToServerTask() void ToServerTask()
{ {
while (true) while (true)
{ {
this.Invoke(new InvokeHandler(delegate()
this.Invoke(new InvokeHandler(delegate ()
{ {
VerifyConnection(); VerifyConnection();
if (connection) if (connection)


+ 3
- 0
WeighAndGrading/GradeFrom.resx View File

@ -159,6 +159,9 @@
<metadata name="H_Livestock_ID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="H_Livestock_ID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>
<metadata name="IsLostWeight.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="H_ReadWeight.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="H_ReadWeight.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>


+ 29
- 3
WeighAndGrading/GradeSettingFrom.Designer.cs View File

@ -47,6 +47,8 @@
this.label8 = new System.Windows.Forms.Label(); this.label8 = new System.Windows.Forms.Label();
this.minInput = new BWP.WinFormControl.UTextBoxWithPad(); this.minInput = new BWP.WinFormControl.UTextBoxWithPad();
this.maxInput = new BWP.WinFormControl.UTextBoxWithPad(); this.maxInput = new BWP.WinFormControl.UTextBoxWithPad();
this.label9 = new System.Windows.Forms.Label();
this.utxtAllowInterval = new BWP.WinFormControl.UTextBoxWithPad();
this.SuspendLayout(); this.SuspendLayout();
// //
// label5 // label5
@ -62,7 +64,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(189, 414);
this.closeBtn.Location = new System.Drawing.Point(173, 461);
this.closeBtn.Name = "closeBtn"; this.closeBtn.Name = "closeBtn";
this.closeBtn.Size = new System.Drawing.Size(75, 35); this.closeBtn.Size = new System.Drawing.Size(75, 35);
this.closeBtn.TabIndex = 19; this.closeBtn.TabIndex = 19;
@ -73,7 +75,7 @@
// saveBtn // saveBtn
// //
this.saveBtn.Font = new System.Drawing.Font("宋体", 15F); this.saveBtn.Font = new System.Drawing.Font("宋体", 15F);
this.saveBtn.Location = new System.Drawing.Point(83, 414);
this.saveBtn.Location = new System.Drawing.Point(67, 461);
this.saveBtn.Name = "saveBtn"; this.saveBtn.Name = "saveBtn";
this.saveBtn.Size = new System.Drawing.Size(75, 35); this.saveBtn.Size = new System.Drawing.Size(75, 35);
this.saveBtn.TabIndex = 18; this.saveBtn.TabIndex = 18;
@ -232,17 +234,38 @@
this.maxInput.TabIndex = 29; this.maxInput.TabIndex = 29;
this.maxInput.Type = BWP.WinFormControl.UTextBoxWithPad.TextBoxType.Number; this.maxInput.Type = BWP.WinFormControl.UTextBoxWithPad.TextBoxType.Number;
// //
// label9
//
this.label9.AutoSize = true;
this.label9.Font = new System.Drawing.Font("宋体", 15F);
this.label9.Location = new System.Drawing.Point(51, 409);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(109, 20);
this.label9.TabIndex = 27;
this.label9.Text = "有效间隔:";
//
// utxtAllowInterval
//
this.utxtAllowInterval.Font = new System.Drawing.Font("宋体", 14F);
this.utxtAllowInterval.Location = new System.Drawing.Point(173, 407);
this.utxtAllowInterval.Name = "utxtAllowInterval";
this.utxtAllowInterval.Size = new System.Drawing.Size(121, 29);
this.utxtAllowInterval.TabIndex = 24;
this.utxtAllowInterval.Type = BWP.WinFormControl.UTextBoxWithPad.TextBoxType.Number;
//
// GradeSettingFrom // GradeSettingFrom
// //
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(354, 463);
this.ClientSize = new System.Drawing.Size(354, 543);
this.ControlBox = false; this.ControlBox = false;
this.Controls.Add(this.maxInput); this.Controls.Add(this.maxInput);
this.Controls.Add(this.minInput); this.Controls.Add(this.minInput);
this.Controls.Add(this.label9);
this.Controls.Add(this.label8); this.Controls.Add(this.label8);
this.Controls.Add(this.weightReadType); this.Controls.Add(this.weightReadType);
this.Controls.Add(this.label7); this.Controls.Add(this.label7);
this.Controls.Add(this.utxtAllowInterval);
this.Controls.Add(this.discont); this.Controls.Add(this.discont);
this.Controls.Add(this.format); this.Controls.Add(this.format);
this.Controls.Add(this.label6); this.Controls.Add(this.label6);
@ -261,6 +284,7 @@
this.Name = "GradeSettingFrom"; this.Name = "GradeSettingFrom";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "称重设置"; this.Text = "称重设置";
this.Load += new System.EventHandler(this.GradeSettingFrom_Load);
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();
@ -287,5 +311,7 @@
private System.Windows.Forms.Label label8; private System.Windows.Forms.Label label8;
private BWP.WinFormControl.UTextBoxWithPad minInput; private BWP.WinFormControl.UTextBoxWithPad minInput;
private BWP.WinFormControl.UTextBoxWithPad maxInput; private BWP.WinFormControl.UTextBoxWithPad maxInput;
private System.Windows.Forms.Label label9;
private BWP.WinFormControl.UTextBoxWithPad utxtAllowInterval;
} }
} }

+ 14
- 0
WeighAndGrading/GradeSettingFrom.cs View File

@ -52,6 +52,8 @@ namespace WeighAndGrading
weightReadType.SelectedIndex = GradeContext.Config.WeightType; weightReadType.SelectedIndex = GradeContext.Config.WeightType;
minInput.Text = GradeContext.Config.MinWeight.ToString(); minInput.Text = GradeContext.Config.MinWeight.ToString();
maxInput.Text = GradeContext.Config.MaxWeight.ToString(); maxInput.Text = GradeContext.Config.MaxWeight.ToString();
utxtAllowInterval.Text = GradeContext.Config.AllowInterval.ToString();
} }
private void saveBtn_Click(object sender, EventArgs e) private void saveBtn_Click(object sender, EventArgs e)
@ -83,6 +85,13 @@ namespace WeighAndGrading
} }
else else
GradeContext.Config.Discont = 0; GradeContext.Config.Discont = 0;
decimal allowInterval;
if (decimal.TryParse(utxtAllowInterval.Text.Trim(), out allowInterval))
{
GradeContext.Config.AllowInterval = allowInterval;
}
GradeContext.Save(); GradeContext.Save();
MessageBox.Show("保存成功!"); MessageBox.Show("保存成功!");
} }
@ -91,5 +100,10 @@ namespace WeighAndGrading
{ {
this.Close(); this.Close();
} }
private void GradeSettingFrom_Load(object sender, EventArgs e)
{
}
} }
} }

+ 9
- 0
WeighAndGrading/WeighAndGrading.csproj View File

@ -49,6 +49,12 @@
<Reference Include="WindowsBase" /> <Reference Include="WindowsBase" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="AbnormalModifyForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="AbnormalModifyForm.Designer.cs">
<DependentUpon>AbnormalModifyForm.cs</DependentUpon>
</Compile>
<Compile Include="BodyDiscontSetting.cs"> <Compile Include="BodyDiscontSetting.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
@ -77,6 +83,9 @@
<Compile Include="WeightGradePrint.cs" /> <Compile Include="WeightGradePrint.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<EmbeddedResource Include="AbnormalModifyForm.resx">
<DependentUpon>AbnormalModifyForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="BodyDiscontSetting.resx"> <EmbeddedResource Include="BodyDiscontSetting.resx">
<DependentUpon>BodyDiscontSetting.cs</DependentUpon> <DependentUpon>BodyDiscontSetting.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>


Loading…
Cancel
Save