| @ -0,0 +1,52 @@ | |||
| using Newtonsoft.Json; | |||
| using SelfHelpClient.BO; | |||
| using SelfHelpClient.Utils; | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.Linq; | |||
| using System.Text; | |||
| using System.Threading.Tasks; | |||
| namespace SelfHelpClient.BL | |||
| { | |||
| public static class WeightBillBL | |||
| { | |||
| public static string ServerUrl; | |||
| static string MethodHead = "/MainSystem/B3ClientService/Rpcs/SelfHelpRpc/"; | |||
| private static ClientRpc mRpc; | |||
| public static ClientRpc Rpc | |||
| { | |||
| get | |||
| { | |||
| if (mRpc == null) | |||
| mRpc = new ClientRpc(ServerUrl); | |||
| return mRpc; | |||
| } | |||
| } | |||
| public static List<ViewEntity> GetViewEntity(string idCard) | |||
| { | |||
| var json = Rpc.Call<string>(MethodHead + "GetViewEntity", idCard); | |||
| return JsonConvert.DeserializeObject<List<ViewEntity>>(json); | |||
| } | |||
| public static WeightBill CreateWeightBill(long id) | |||
| { | |||
| var json = Rpc.Call<string>(MethodHead + "CreateWeightBill", id); | |||
| return JsonConvert.DeserializeObject<WeightBill>(json); | |||
| } | |||
| public static WeightBill GetWeightBill(long id) | |||
| { | |||
| var json = Rpc.Call<string>(MethodHead + "GetWeightBill", id); | |||
| return JsonConvert.DeserializeObject<WeightBill>(json); | |||
| } | |||
| public static List<WeightBill_WeightDetail> GetWeightDetail(long id) | |||
| { | |||
| var json = Rpc.Call<string>(MethodHead + "GetWeightDetail", id); | |||
| return JsonConvert.DeserializeObject<List<WeightBill_WeightDetail>>(json); | |||
| } | |||
| } | |||
| } | |||
| @ -0,0 +1,21 @@ | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.Linq; | |||
| using System.Text; | |||
| using System.Threading.Tasks; | |||
| namespace SelfHelpClient.BO | |||
| { | |||
| public class ViewEntity | |||
| { | |||
| public long ID { get; set; } | |||
| public int BillType { get; set; } | |||
| public string CarNumber { get; set; } | |||
| public int Number { get; set; } | |||
| public DateTime Date { get; set; } | |||
| } | |||
| } | |||
| @ -0,0 +1,42 @@ | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.Linq; | |||
| using System.Text; | |||
| using System.Threading.Tasks; | |||
| namespace SelfHelpClient.BO | |||
| { | |||
| public class WeightBill | |||
| { | |||
| public long ID { get; set; } | |||
| public string Supplier_Name { get; set; } | |||
| public string PurchaseType_Name { get; set; } | |||
| public DateTime WeighTime { get; set; } | |||
| public string Car_Name { get; set; } | |||
| public string Employee_Name { get; set; } | |||
| public decimal? JingJianFee { get; set; } | |||
| public decimal? DiscontMoney { get; set; } | |||
| public decimal? ShackWeight { get; set; } | |||
| public decimal? ShackPrice { get; set; } | |||
| public decimal? ShackMoney { get; set; } | |||
| public string AnimalTestMan { get; set; } | |||
| public string AnimalTestNumber { get; set; } | |||
| public DateTime? AnimalTestDate { get; set; } | |||
| public List<WeightBill_FarmerDetail> FarmerDetails { get; set; } | |||
| public List<WeightBill_WeightDetail> Details { get; set; } | |||
| } | |||
| } | |||
| @ -0,0 +1,29 @@ | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.Linq; | |||
| using System.Text; | |||
| using System.Threading.Tasks; | |||
| namespace SelfHelpClient.BO | |||
| { | |||
| public class WeightBill_FarmerDetail | |||
| { | |||
| public int Index { get; set; } | |||
| public string Farmer_Name { get; set; } | |||
| public int? Number { get; set; } | |||
| public decimal? Weight { get; set; } | |||
| public decimal? Money { get; set; } | |||
| public string Farmer_IDCard { get; set; } | |||
| public string Farmer_BankAccount { get; set; } | |||
| public string Farmer_Tel { get; set; } | |||
| public string Farmer_Address { get; set; } | |||
| } | |||
| } | |||
| @ -0,0 +1,21 @@ | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.Linq; | |||
| using System.Text; | |||
| using System.Threading.Tasks; | |||
| namespace SelfHelpClient.BO | |||
| { | |||
| public class WeightBill_WeightDetail | |||
| { | |||
| public string Index { get; set; } | |||
| public int? Number { get; set; } | |||
| public decimal? PiWeight { get; set; } | |||
| public decimal? MaoWeight { get; set; } | |||
| public decimal? Weight { get; set; } | |||
| } | |||
| } | |||
| @ -0,0 +1,86 @@ | |||
| namespace SelfHelpClient | |||
| { | |||
| partial class DialogForm | |||
| { | |||
| /// <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() | |||
| { | |||
| this.msgLbl = new WinFormControl.ULabel(); | |||
| this.okBtn = new WinFormControl.NButton(); | |||
| this.SuspendLayout(); | |||
| // | |||
| // msgLbl | |||
| // | |||
| this.msgLbl.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | |||
| | System.Windows.Forms.AnchorStyles.Right))); | |||
| this.msgLbl.BackColor = System.Drawing.Color.Transparent; | |||
| this.msgLbl.Font = new System.Drawing.Font("宋体", 18F); | |||
| this.msgLbl.ForeColor = System.Drawing.Color.Red; | |||
| this.msgLbl.Location = new System.Drawing.Point(64, 43); | |||
| this.msgLbl.Name = "msgLbl"; | |||
| this.msgLbl.Size = new System.Drawing.Size(286, 97); | |||
| this.msgLbl.TabIndex = 0; | |||
| this.msgLbl.Text = "uLabel1"; | |||
| this.msgLbl.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; | |||
| // | |||
| // okBtn | |||
| // | |||
| this.okBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(136)))), ((int)(((byte)(255))))); | |||
| this.okBtn.ClickColor = System.Drawing.Color.YellowGreen; | |||
| this.okBtn.Font = new System.Drawing.Font("宋体", 18F); | |||
| this.okBtn.ForeColor = System.Drawing.Color.White; | |||
| this.okBtn.Location = new System.Drawing.Point(124, 156); | |||
| this.okBtn.Name = "okBtn"; | |||
| this.okBtn.PlaySound = false; | |||
| this.okBtn.Size = new System.Drawing.Size(158, 63); | |||
| this.okBtn.SoundType = WinFormControl.SoundType.Click; | |||
| this.okBtn.TabIndex = 1; | |||
| this.okBtn.Text = "nButton1"; | |||
| this.okBtn.ToColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(136)))), ((int)(((byte)(255))))); | |||
| this.okBtn.UseVisualStyleBackColor = false; | |||
| this.okBtn.Click += new System.EventHandler(this.okBtn_Click); | |||
| // | |||
| // DialogForm | |||
| // | |||
| this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); | |||
| this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; | |||
| this.ClientSize = new System.Drawing.Size(417, 251); | |||
| this.Controls.Add(this.okBtn); | |||
| this.Controls.Add(this.msgLbl); | |||
| this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; | |||
| this.Name = "DialogForm"; | |||
| this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; | |||
| this.Text = "DialogForm"; | |||
| this.ResumeLayout(false); | |||
| } | |||
| #endregion | |||
| private WinFormControl.ULabel msgLbl; | |||
| private WinFormControl.NButton okBtn; | |||
| } | |||
| } | |||
| @ -0,0 +1,72 @@ | |||
| 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; | |||
| namespace SelfHelpClient | |||
| { | |||
| public partial class DialogForm : Form | |||
| { | |||
| System.Timers.Timer timer; | |||
| int sec = 0; | |||
| private DialogForm(string msg, int closeSec) | |||
| { | |||
| InitializeComponent(); | |||
| msgLbl.Text = msg; | |||
| okBtn.Text = "确定"; | |||
| if (closeSec > 0) | |||
| { | |||
| sec = closeSec; | |||
| timer = new System.Timers.Timer(); | |||
| timer.Interval = 1000; | |||
| timer.Elapsed += timer_Elapsed; | |||
| timer.Start(); | |||
| } | |||
| this.FormClosing += DialogForm_FormClosing; | |||
| } | |||
| void DialogForm_FormClosing(object sender, FormClosingEventArgs e) | |||
| { | |||
| if (timer != null) | |||
| { | |||
| if (timer.Enabled) | |||
| timer.Enabled = false; | |||
| timer.Dispose(); | |||
| } | |||
| } | |||
| void timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) | |||
| { | |||
| this.Invoke(new Action(() => | |||
| { | |||
| if (sec > 0) | |||
| { | |||
| this.okBtn.Text = string.Format("确定({0}秒)", sec); | |||
| sec--; | |||
| } | |||
| else | |||
| { | |||
| timer.Enabled = false; | |||
| this.Close(); | |||
| } | |||
| })); | |||
| } | |||
| public static void ShowDialog(string msg, int closeSec = 0) | |||
| { | |||
| var d = new DialogForm(msg, closeSec); | |||
| d.ShowDialog(); | |||
| } | |||
| private void okBtn_Click(object sender, EventArgs e) | |||
| { | |||
| this.Close(); | |||
| } | |||
| } | |||
| } | |||
| @ -0,0 +1,120 @@ | |||
| <?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> | |||
| </root> | |||
| @ -0,0 +1,173 @@ | |||
| namespace SelfHelpClient | |||
| { | |||
| partial class ItemSelect | |||
| { | |||
| /// <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 dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); | |||
| System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); | |||
| this.uDataGridView1 = new WinFormControl.UDataGridView(); | |||
| this.R_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); | |||
| this.R_CarNumber = new System.Windows.Forms.DataGridViewTextBoxColumn(); | |||
| this.R_Number = new System.Windows.Forms.DataGridViewTextBoxColumn(); | |||
| this.R_Date = new System.Windows.Forms.DataGridViewTextBoxColumn(); | |||
| this.uLabel1 = new WinFormControl.ULabel(); | |||
| this.backBtn = new WinFormControl.NButton(); | |||
| ((System.ComponentModel.ISupportInitialize)(this.uDataGridView1)).BeginInit(); | |||
| this.SuspendLayout(); | |||
| // | |||
| // 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; | |||
| this.uDataGridView1.BorderStyle = System.Windows.Forms.BorderStyle.None; | |||
| dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; | |||
| dataGridViewCellStyle2.Font = new System.Drawing.Font("宋体", 23F); | |||
| dataGridViewCellStyle2.ForeColor = System.Drawing.Color.White; | |||
| 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.R_ID, | |||
| this.R_CarNumber, | |||
| this.R_Number, | |||
| this.R_Date}); | |||
| this.uDataGridView1.Dock = System.Windows.Forms.DockStyle.Bottom; | |||
| this.uDataGridView1.Location = new System.Drawing.Point(0, 68); | |||
| this.uDataGridView1.MultiSelect = false; | |||
| this.uDataGridView1.Name = "uDataGridView1"; | |||
| this.uDataGridView1.ReadOnly = true; | |||
| this.uDataGridView1.RowHeadersVisible = false; | |||
| dataGridViewCellStyle4.Font = new System.Drawing.Font("宋体", 18F); | |||
| dataGridViewCellStyle4.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); | |||
| this.uDataGridView1.RowsDefaultCellStyle = dataGridViewCellStyle4; | |||
| this.uDataGridView1.RowTemplate.Height = 80; | |||
| this.uDataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; | |||
| this.uDataGridView1.Size = new System.Drawing.Size(650, 332); | |||
| this.uDataGridView1.TabIndex = 0; | |||
| this.uDataGridView1.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.uDataGridView1_CellClick); | |||
| // | |||
| // R_ID | |||
| // | |||
| this.R_ID.HeaderText = "ID"; | |||
| this.R_ID.Name = "R_ID"; | |||
| this.R_ID.ReadOnly = true; | |||
| this.R_ID.Visible = false; | |||
| // | |||
| // R_CarNumber | |||
| // | |||
| this.R_CarNumber.DataPropertyName = "CarNumber"; | |||
| this.R_CarNumber.HeaderText = "车辆"; | |||
| this.R_CarNumber.Name = "R_CarNumber"; | |||
| this.R_CarNumber.ReadOnly = true; | |||
| this.R_CarNumber.Width = 220; | |||
| // | |||
| // R_Number | |||
| // | |||
| this.R_Number.DataPropertyName = "Number"; | |||
| this.R_Number.HeaderText = "头数"; | |||
| this.R_Number.Name = "R_Number"; | |||
| this.R_Number.ReadOnly = true; | |||
| this.R_Number.Width = 150; | |||
| // | |||
| // R_Date | |||
| // | |||
| this.R_Date.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; | |||
| this.R_Date.DataPropertyName = "Date"; | |||
| dataGridViewCellStyle3.Format = "yyyy-MM-dd HH:mm:ss"; | |||
| this.R_Date.DefaultCellStyle = dataGridViewCellStyle3; | |||
| this.R_Date.HeaderText = "时间"; | |||
| this.R_Date.Name = "R_Date"; | |||
| this.R_Date.ReadOnly = true; | |||
| // | |||
| // uLabel1 | |||
| // | |||
| this.uLabel1.AutoSize = true; | |||
| this.uLabel1.BackColor = System.Drawing.Color.Transparent; | |||
| this.uLabel1.Font = new System.Drawing.Font("宋体", 18F); | |||
| this.uLabel1.ForeColor = System.Drawing.Color.Red; | |||
| this.uLabel1.Location = new System.Drawing.Point(12, 19); | |||
| this.uLabel1.Name = "uLabel1"; | |||
| this.uLabel1.Size = new System.Drawing.Size(298, 24); | |||
| this.uLabel1.TabIndex = 1; | |||
| this.uLabel1.Text = "请选择要办理的送猪信息单"; | |||
| // | |||
| // backBtn | |||
| // | |||
| this.backBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(136)))), ((int)(((byte)(255))))); | |||
| this.backBtn.ClickColor = System.Drawing.Color.YellowGreen; | |||
| this.backBtn.Font = new System.Drawing.Font("宋体", 18F); | |||
| this.backBtn.ForeColor = System.Drawing.Color.White; | |||
| this.backBtn.Location = new System.Drawing.Point(533, 3); | |||
| this.backBtn.Name = "backBtn"; | |||
| this.backBtn.PlaySound = false; | |||
| this.backBtn.Size = new System.Drawing.Size(113, 63); | |||
| this.backBtn.SoundType = WinFormControl.SoundType.Click; | |||
| this.backBtn.TabIndex = 2; | |||
| this.backBtn.TabStop = false; | |||
| this.backBtn.Text = "返回"; | |||
| this.backBtn.ToColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(136)))), ((int)(((byte)(255))))); | |||
| this.backBtn.UseVisualStyleBackColor = false; | |||
| this.backBtn.Click += new System.EventHandler(this.backBtn_Click); | |||
| // | |||
| // ItemSelect | |||
| // | |||
| this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); | |||
| this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; | |||
| this.BackColor = System.Drawing.SystemColors.Control; | |||
| this.ClientSize = new System.Drawing.Size(650, 400); | |||
| this.Controls.Add(this.backBtn); | |||
| this.Controls.Add(this.uLabel1); | |||
| this.Controls.Add(this.uDataGridView1); | |||
| this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; | |||
| this.Name = "ItemSelect"; | |||
| this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; | |||
| this.Text = "ItemSelect"; | |||
| ((System.ComponentModel.ISupportInitialize)(this.uDataGridView1)).EndInit(); | |||
| this.ResumeLayout(false); | |||
| this.PerformLayout(); | |||
| } | |||
| #endregion | |||
| private WinFormControl.UDataGridView uDataGridView1; | |||
| private WinFormControl.ULabel uLabel1; | |||
| private WinFormControl.NButton backBtn; | |||
| private System.Windows.Forms.DataGridViewTextBoxColumn R_ID; | |||
| private System.Windows.Forms.DataGridViewTextBoxColumn R_CarNumber; | |||
| private System.Windows.Forms.DataGridViewTextBoxColumn R_Number; | |||
| private System.Windows.Forms.DataGridViewTextBoxColumn R_Date; | |||
| } | |||
| } | |||
| @ -0,0 +1,45 @@ | |||
| using SelfHelpClient.BO; | |||
| 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; | |||
| namespace SelfHelpClient | |||
| { | |||
| public partial class ItemSelect : Form | |||
| { | |||
| List<ViewEntity> list; | |||
| ReadCardForm form; | |||
| public ItemSelect(List<ViewEntity> mlist, ReadCardForm mForm) | |||
| { | |||
| InitializeComponent(); | |||
| form = mForm; | |||
| list = mlist; | |||
| } | |||
| protected override void OnLoad(EventArgs e) | |||
| { | |||
| base.OnLoad(e); | |||
| uDataGridView1.DataSource = list; | |||
| uDataGridView1.Refresh(); | |||
| } | |||
| private void uDataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) | |||
| { | |||
| if (e.RowIndex < 0) | |||
| return; | |||
| form.VEntity = uDataGridView1.CurrentRow.DataBoundItem as ViewEntity; | |||
| DialogResult = DialogResult.OK; | |||
| } | |||
| private void backBtn_Click(object sender, EventArgs e) | |||
| { | |||
| this.Close(); | |||
| } | |||
| } | |||
| } | |||
| @ -0,0 +1,132 @@ | |||
| <?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="R_ID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
| <value>True</value> | |||
| </metadata> | |||
| <metadata name="R_CarNumber.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
| <value>True</value> | |||
| </metadata> | |||
| <metadata name="R_Number.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
| <value>True</value> | |||
| </metadata> | |||
| <metadata name="R_Date.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
| <value>True</value> | |||
| </metadata> | |||
| </root> | |||
| @ -0,0 +1,125 @@ | |||
| namespace SelfHelpClient | |||
| { | |||
| partial class MainForm | |||
| { | |||
| /// <summary> | |||
| /// 必需的设计器变量。 | |||
| /// </summary> | |||
| private System.ComponentModel.IContainer components = null; | |||
| /// <summary> | |||
| /// 清理所有正在使用的资源。 | |||
| /// </summary> | |||
| /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param> | |||
| protected override void Dispose(bool disposing) | |||
| { | |||
| if (disposing && (components != null)) | |||
| { | |||
| components.Dispose(); | |||
| } | |||
| base.Dispose(disposing); | |||
| } | |||
| #region Windows 窗体设计器生成的代码 | |||
| /// <summary> | |||
| /// 设计器支持所需的方法 - 不要 | |||
| /// 使用代码编辑器修改此方法的内容。 | |||
| /// </summary> | |||
| private void InitializeComponent() | |||
| { | |||
| this.panel1 = new System.Windows.Forms.Panel(); | |||
| this.weightBtn = new WinFormControl.NButton(); | |||
| this.selfBtn = new WinFormControl.NButton(); | |||
| this.testClose = new WinFormControl.NButton(); | |||
| this.panel1.SuspendLayout(); | |||
| this.SuspendLayout(); | |||
| // | |||
| // panel1 | |||
| // | |||
| this.panel1.Anchor = System.Windows.Forms.AnchorStyles.None; | |||
| this.panel1.Controls.Add(this.weightBtn); | |||
| this.panel1.Controls.Add(this.selfBtn); | |||
| this.panel1.Location = new System.Drawing.Point(136, 137); | |||
| this.panel1.Name = "panel1"; | |||
| this.panel1.Size = new System.Drawing.Size(644, 271); | |||
| this.panel1.TabIndex = 0; | |||
| // | |||
| // weightBtn | |||
| // | |||
| this.weightBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(136)))), ((int)(((byte)(255))))); | |||
| this.weightBtn.ClickColor = System.Drawing.Color.YellowGreen; | |||
| this.weightBtn.Font = new System.Drawing.Font("宋体", 23F); | |||
| this.weightBtn.ForeColor = System.Drawing.Color.White; | |||
| this.weightBtn.Location = new System.Drawing.Point(392, 64); | |||
| this.weightBtn.Name = "weightBtn"; | |||
| this.weightBtn.PlaySound = true; | |||
| this.weightBtn.Size = new System.Drawing.Size(235, 128); | |||
| this.weightBtn.SoundType = WinFormControl.SoundType.Click; | |||
| this.weightBtn.TabIndex = 1; | |||
| this.weightBtn.Text = "送猪过磅"; | |||
| this.weightBtn.ToColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(136)))), ((int)(((byte)(255))))); | |||
| this.weightBtn.UseVisualStyleBackColor = false; | |||
| this.weightBtn.Click += new System.EventHandler(this.weightBtn_Click); | |||
| // | |||
| // selfBtn | |||
| // | |||
| this.selfBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(136)))), ((int)(((byte)(255))))); | |||
| this.selfBtn.ClickColor = System.Drawing.Color.YellowGreen; | |||
| this.selfBtn.Font = new System.Drawing.Font("宋体", 23F); | |||
| this.selfBtn.ForeColor = System.Drawing.Color.White; | |||
| this.selfBtn.Location = new System.Drawing.Point(23, 64); | |||
| this.selfBtn.Name = "selfBtn"; | |||
| this.selfBtn.PlaySound = true; | |||
| this.selfBtn.Size = new System.Drawing.Size(235, 128); | |||
| this.selfBtn.SoundType = WinFormControl.SoundType.Click; | |||
| this.selfBtn.TabIndex = 0; | |||
| this.selfBtn.Text = "自助服务"; | |||
| this.selfBtn.ToColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(136)))), ((int)(((byte)(255))))); | |||
| this.selfBtn.UseVisualStyleBackColor = false; | |||
| this.selfBtn.Click += new System.EventHandler(this.selfBtn_Click); | |||
| // | |||
| // testClose | |||
| // | |||
| this.testClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); | |||
| this.testClose.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(136)))), ((int)(((byte)(255))))); | |||
| this.testClose.ClickColor = System.Drawing.Color.YellowGreen; | |||
| this.testClose.Font = new System.Drawing.Font("宋体", 12F); | |||
| this.testClose.ForeColor = System.Drawing.Color.White; | |||
| this.testClose.Location = new System.Drawing.Point(798, 12); | |||
| this.testClose.Name = "testClose"; | |||
| this.testClose.PlaySound = false; | |||
| this.testClose.Size = new System.Drawing.Size(99, 59); | |||
| this.testClose.SoundType = WinFormControl.SoundType.Click; | |||
| this.testClose.TabIndex = 1; | |||
| this.testClose.Text = "测试用"; | |||
| this.testClose.ToColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(136)))), ((int)(((byte)(255))))); | |||
| this.testClose.UseVisualStyleBackColor = false; | |||
| this.testClose.Click += new System.EventHandler(this.testClose_Click); | |||
| // | |||
| // MainForm | |||
| // | |||
| this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); | |||
| this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; | |||
| this.BackColor = System.Drawing.Color.LightGray; | |||
| this.ClientSize = new System.Drawing.Size(928, 521); | |||
| this.Controls.Add(this.testClose); | |||
| this.Controls.Add(this.panel1); | |||
| this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; | |||
| this.Name = "MainForm"; | |||
| this.Text = "Form1"; | |||
| this.WindowState = System.Windows.Forms.FormWindowState.Maximized; | |||
| this.panel1.ResumeLayout(false); | |||
| this.ResumeLayout(false); | |||
| } | |||
| #endregion | |||
| private System.Windows.Forms.Panel panel1; | |||
| private WinFormControl.NButton selfBtn; | |||
| private WinFormControl.NButton weightBtn; | |||
| private WinFormControl.NButton testClose; | |||
| } | |||
| } | |||
| @ -0,0 +1,67 @@ | |||
| using SelfHelpClient.BL; | |||
| using SelfHelpClient.BO; | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.ComponentModel; | |||
| using System.Data; | |||
| using System.Drawing; | |||
| using System.IO; | |||
| using System.Linq; | |||
| using System.Text; | |||
| using System.Windows.Forms; | |||
| namespace SelfHelpClient | |||
| { | |||
| public partial class MainForm : Form | |||
| { | |||
| private static MainForm mForm; | |||
| public static MainForm Form | |||
| { | |||
| get { return mForm; } | |||
| } | |||
| public MainForm() | |||
| { | |||
| if (!File.Exists("AppConfig.cfg")) | |||
| { | |||
| MessageBox.Show("请先配置服务器地址"); | |||
| this.Close(); | |||
| } | |||
| WeightBillBL.ServerUrl = File.ReadAllText("AppConfig.cfg"); | |||
| mForm = this; | |||
| InitializeComponent(); | |||
| } | |||
| private void selfBtn_Click(object sender, EventArgs e) | |||
| { | |||
| var entity = ReadCard(); | |||
| if (entity == null) | |||
| return; | |||
| if (entity.BillType == 0) | |||
| return; | |||
| new SelfHelpForm(entity.ID).Show(); | |||
| this.Hide(); | |||
| } | |||
| private void weightBtn_Click(object sender, EventArgs e) | |||
| { | |||
| var entity = ReadCard(); | |||
| if (entity == null) | |||
| return; | |||
| new WeightForm(entity).Show(); | |||
| this.Hide(); | |||
| } | |||
| ViewEntity ReadCard() | |||
| { | |||
| var reader = new ReadCardForm(); | |||
| if (reader.ShowDialog() == DialogResult.OK) | |||
| return reader.VEntity; | |||
| return null; ; | |||
| } | |||
| private void testClose_Click(object sender, EventArgs e) | |||
| { | |||
| this.Close(); | |||
| } | |||
| } | |||
| } | |||
| @ -0,0 +1,120 @@ | |||
| <?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> | |||
| </root> | |||
| @ -0,0 +1,21 @@ | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.Linq; | |||
| using System.Windows.Forms; | |||
| namespace SelfHelpClient | |||
| { | |||
| static class Program | |||
| { | |||
| /// <summary> | |||
| /// 应用程序的主入口点。 | |||
| /// </summary> | |||
| [STAThread] | |||
| static void Main() | |||
| { | |||
| Application.EnableVisualStyles(); | |||
| Application.SetCompatibleTextRenderingDefault(false); | |||
| Application.Run(new MainForm()); | |||
| } | |||
| } | |||
| } | |||
| @ -0,0 +1,36 @@ | |||
| using System.Reflection; | |||
| using System.Runtime.CompilerServices; | |||
| using System.Runtime.InteropServices; | |||
| // 有关程序集的常规信息通过以下 | |||
| // 特性集控制。更改这些特性值可修改 | |||
| // 与程序集关联的信息。 | |||
| [assembly: AssemblyTitle("SelfHelpClient")] | |||
| [assembly: AssemblyDescription("")] | |||
| [assembly: AssemblyConfiguration("")] | |||
| [assembly: AssemblyCompany("")] | |||
| [assembly: AssemblyProduct("SelfHelpClient")] | |||
| [assembly: AssemblyCopyright("Copyright © 2018")] | |||
| [assembly: AssemblyTrademark("")] | |||
| [assembly: AssemblyCulture("")] | |||
| // 将 ComVisible 设置为 false 使此程序集中的类型 | |||
| // 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, | |||
| // 则将该类型上的 ComVisible 特性设置为 true。 | |||
| [assembly: ComVisible(false)] | |||
| // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID | |||
| [assembly: Guid("d68a4767-63a5-414c-af38-9111ad6b3e03")] | |||
| // 程序集的版本信息由下面四个值组成: | |||
| // | |||
| // 主版本 | |||
| // 次版本 | |||
| // 生成号 | |||
| // 修订号 | |||
| // | |||
| // 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, | |||
| // 方法是按如下所示使用“*”: | |||
| // [assembly: AssemblyVersion("1.0.*")] | |||
| [assembly: AssemblyVersion("1.0.0.0")] | |||
| [assembly: AssemblyFileVersion("1.0.0.0")] | |||
| @ -0,0 +1,63 @@ | |||
| //------------------------------------------------------------------------------ | |||
| // <auto-generated> | |||
| // 此代码由工具生成。 | |||
| // 运行时版本:4.0.30319.42000 | |||
| // | |||
| // 对此文件的更改可能会导致不正确的行为,并且如果 | |||
| // 重新生成代码,这些更改将会丢失。 | |||
| // </auto-generated> | |||
| //------------------------------------------------------------------------------ | |||
| namespace SelfHelpClient.Properties { | |||
| using System; | |||
| /// <summary> | |||
| /// 一个强类型的资源类,用于查找本地化的字符串等。 | |||
| /// </summary> | |||
| // 此类是由 StronglyTypedResourceBuilder | |||
| // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 | |||
| // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen | |||
| // (以 /str 作为命令选项),或重新生成 VS 项目。 | |||
| [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] | |||
| [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] | |||
| [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] | |||
| internal class Resources { | |||
| private static global::System.Resources.ResourceManager resourceMan; | |||
| private static global::System.Globalization.CultureInfo resourceCulture; | |||
| [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] | |||
| internal Resources() { | |||
| } | |||
| /// <summary> | |||
| /// 返回此类使用的缓存的 ResourceManager 实例。 | |||
| /// </summary> | |||
| [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] | |||
| internal static global::System.Resources.ResourceManager ResourceManager { | |||
| get { | |||
| if (object.ReferenceEquals(resourceMan, null)) { | |||
| global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SelfHelpClient.Properties.Resources", typeof(Resources).Assembly); | |||
| resourceMan = temp; | |||
| } | |||
| return resourceMan; | |||
| } | |||
| } | |||
| /// <summary> | |||
| /// 使用此强类型资源类,为所有资源查找 | |||
| /// 重写当前线程的 CurrentUICulture 属性。 | |||
| /// </summary> | |||
| [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] | |||
| internal static global::System.Globalization.CultureInfo Culture { | |||
| get { | |||
| return resourceCulture; | |||
| } | |||
| set { | |||
| resourceCulture = value; | |||
| } | |||
| } | |||
| } | |||
| } | |||
| @ -0,0 +1,117 @@ | |||
| <?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.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: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" type="xsd:string" /> | |||
| <xsd:attribute name="type" type="xsd:string" /> | |||
| <xsd:attribute name="mimetype" type="xsd:string" /> | |||
| </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" msdata:Ordinal="1" /> | |||
| <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> | |||
| <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> | |||
| </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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |||
| </resheader> | |||
| <resheader name="writer"> | |||
| <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |||
| </resheader> | |||
| </root> | |||
| @ -0,0 +1,26 @@ | |||
| //------------------------------------------------------------------------------ | |||
| // <auto-generated> | |||
| // 此代码由工具生成。 | |||
| // 运行时版本:4.0.30319.42000 | |||
| // | |||
| // 对此文件的更改可能会导致不正确的行为,并且如果 | |||
| // 重新生成代码,这些更改将会丢失。 | |||
| // </auto-generated> | |||
| //------------------------------------------------------------------------------ | |||
| namespace SelfHelpClient.Properties { | |||
| [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] | |||
| [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")] | |||
| internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { | |||
| private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); | |||
| public static Settings Default { | |||
| get { | |||
| return defaultInstance; | |||
| } | |||
| } | |||
| } | |||
| } | |||
| @ -0,0 +1,7 @@ | |||
| <?xml version='1.0' encoding='utf-8'?> | |||
| <SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)"> | |||
| <Profiles> | |||
| <Profile Name="(Default)" /> | |||
| </Profiles> | |||
| <Settings /> | |||
| </SettingsFile> | |||
| @ -0,0 +1,88 @@ | |||
| namespace SelfHelpClient | |||
| { | |||
| partial class ReadCardForm | |||
| { | |||
| /// <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() | |||
| { | |||
| this.uLabel1 = new WinFormControl.ULabel(); | |||
| this.backBtn = new WinFormControl.NButton(); | |||
| this.SuspendLayout(); | |||
| // | |||
| // uLabel1 | |||
| // | |||
| this.uLabel1.AutoSize = true; | |||
| this.uLabel1.BackColor = System.Drawing.Color.Transparent; | |||
| this.uLabel1.Font = new System.Drawing.Font("宋体", 23F); | |||
| this.uLabel1.ForeColor = System.Drawing.Color.Red; | |||
| this.uLabel1.Location = new System.Drawing.Point(222, 147); | |||
| this.uLabel1.Name = "uLabel1"; | |||
| this.uLabel1.Size = new System.Drawing.Size(200, 31); | |||
| this.uLabel1.TabIndex = 0; | |||
| this.uLabel1.Text = "请扫描身份证"; | |||
| // | |||
| // backBtn | |||
| // | |||
| this.backBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(136)))), ((int)(((byte)(255))))); | |||
| this.backBtn.ClickColor = System.Drawing.Color.YellowGreen; | |||
| this.backBtn.Font = new System.Drawing.Font("宋体", 18F); | |||
| this.backBtn.ForeColor = System.Drawing.Color.White; | |||
| this.backBtn.Location = new System.Drawing.Point(529, 12); | |||
| this.backBtn.Name = "backBtn"; | |||
| this.backBtn.PlaySound = false; | |||
| this.backBtn.Size = new System.Drawing.Size(113, 63); | |||
| this.backBtn.SoundType = WinFormControl.SoundType.Click; | |||
| this.backBtn.TabIndex = 1; | |||
| this.backBtn.TabStop = false; | |||
| this.backBtn.Text = "返回"; | |||
| this.backBtn.ToColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(136)))), ((int)(((byte)(255))))); | |||
| this.backBtn.UseVisualStyleBackColor = false; | |||
| this.backBtn.Click += new System.EventHandler(this.backBtn_Click); | |||
| // | |||
| // ReadCardForm | |||
| // | |||
| this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); | |||
| this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; | |||
| this.BackColor = System.Drawing.Color.White; | |||
| this.ClientSize = new System.Drawing.Size(650, 355); | |||
| this.Controls.Add(this.backBtn); | |||
| this.Controls.Add(this.uLabel1); | |||
| this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; | |||
| this.ImeMode = System.Windows.Forms.ImeMode.Disable; | |||
| this.KeyPreview = true; | |||
| this.Name = "ReadCardForm"; | |||
| this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; | |||
| this.ResumeLayout(false); | |||
| this.PerformLayout(); | |||
| } | |||
| #endregion | |||
| private WinFormControl.ULabel uLabel1; | |||
| private WinFormControl.NButton backBtn; | |||
| } | |||
| } | |||
| @ -0,0 +1,58 @@ | |||
| using SelfHelpClient.BL; | |||
| using SelfHelpClient.BO; | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.ComponentModel; | |||
| using System.Data; | |||
| using System.Drawing; | |||
| using System.Linq; | |||
| using System.Text; | |||
| using System.Threading; | |||
| using System.Threading.Tasks; | |||
| using System.Windows.Forms; | |||
| namespace SelfHelpClient | |||
| { | |||
| public partial class ReadCardForm : Form | |||
| { | |||
| string _cardNumber = ""; | |||
| public ViewEntity VEntity { get; set; } | |||
| public ReadCardForm() | |||
| { | |||
| InitializeComponent(); | |||
| this.KeyPress += ReadCardForm_KeyPress; | |||
| } | |||
| void ReadCardForm_KeyPress(object sender, KeyPressEventArgs e) | |||
| { | |||
| if (e.KeyChar == (char)Keys.Tab) | |||
| { | |||
| FillViewEntity(_cardNumber); | |||
| DialogResult = DialogResult.OK; | |||
| } | |||
| else | |||
| _cardNumber += e.KeyChar.ToString(); | |||
| } | |||
| private void FillViewEntity(string idCard) | |||
| { | |||
| var list = WeightBillBL.GetViewEntity(idCard); | |||
| if (list.Count == 0) | |||
| { | |||
| DialogForm.ShowDialog("没有待办理业务", 5); | |||
| this.Close(); | |||
| } | |||
| else if (list.Count == 1) | |||
| VEntity = list.First(); | |||
| else | |||
| { | |||
| new ItemSelect(list, this).ShowDialog(); | |||
| } | |||
| } | |||
| private void backBtn_Click(object sender, EventArgs e) | |||
| { | |||
| this.Close(); | |||
| } | |||
| } | |||
| } | |||
| @ -0,0 +1,120 @@ | |||
| <?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> | |||
| </root> | |||
| @ -0,0 +1,149 @@ | |||
| <?xml version="1.0" encoding="utf-8"?> | |||
| <Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |||
| <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> | |||
| <PropertyGroup> | |||
| <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | |||
| <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | |||
| <ProjectGuid>{51EF4E9D-1148-4055-8B1A-9A9DBCA12A03}</ProjectGuid> | |||
| <OutputType>WinExe</OutputType> | |||
| <AppDesignerFolder>Properties</AppDesignerFolder> | |||
| <RootNamespace>SelfHelpClient</RootNamespace> | |||
| <AssemblyName>SelfHelpClient</AssemblyName> | |||
| <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> | |||
| <FileAlignment>512</FileAlignment> | |||
| <TargetFrameworkProfile /> | |||
| </PropertyGroup> | |||
| <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | |||
| <PlatformTarget>AnyCPU</PlatformTarget> | |||
| <DebugSymbols>true</DebugSymbols> | |||
| <DebugType>full</DebugType> | |||
| <Optimize>false</Optimize> | |||
| <OutputPath>bin\Debug\</OutputPath> | |||
| <DefineConstants>DEBUG;TRACE</DefineConstants> | |||
| <ErrorReport>prompt</ErrorReport> | |||
| <WarningLevel>4</WarningLevel> | |||
| <Prefer32Bit>false</Prefer32Bit> | |||
| </PropertyGroup> | |||
| <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | |||
| <PlatformTarget>AnyCPU</PlatformTarget> | |||
| <DebugType>pdbonly</DebugType> | |||
| <Optimize>true</Optimize> | |||
| <OutputPath>bin\Release\</OutputPath> | |||
| <DefineConstants>TRACE</DefineConstants> | |||
| <ErrorReport>prompt</ErrorReport> | |||
| <WarningLevel>4</WarningLevel> | |||
| <Prefer32Bit>false</Prefer32Bit> | |||
| </PropertyGroup> | |||
| <ItemGroup> | |||
| <Reference Include="Newtonsoft.Json, Version=4.0.3.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> | |||
| <SpecificVersion>False</SpecificVersion> | |||
| <HintPath>..\..\..\tsref\release\Newtonsoft.Json.dll</HintPath> | |||
| </Reference> | |||
| <Reference Include="PresentationCore" /> | |||
| <Reference Include="PresentationFramework" /> | |||
| <Reference Include="System" /> | |||
| <Reference Include="System.Core" /> | |||
| <Reference Include="System.Xaml" /> | |||
| <Reference Include="System.Xml.Linq" /> | |||
| <Reference Include="System.Data.DataSetExtensions" /> | |||
| <Reference Include="Microsoft.CSharp" /> | |||
| <Reference Include="System.Data" /> | |||
| <Reference Include="System.Deployment" /> | |||
| <Reference Include="System.Drawing" /> | |||
| <Reference Include="System.Windows.Forms" /> | |||
| <Reference Include="System.Xml" /> | |||
| <Reference Include="WindowsBase" /> | |||
| <Reference Include="WinFormControl, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL" /> | |||
| </ItemGroup> | |||
| <ItemGroup> | |||
| <Compile Include="BL\WeightBillBL.cs" /> | |||
| <Compile Include="BO\ViewEntity.cs" /> | |||
| <Compile Include="DialogForm.cs"> | |||
| <SubType>Form</SubType> | |||
| </Compile> | |||
| <Compile Include="DialogForm.Designer.cs"> | |||
| <DependentUpon>DialogForm.cs</DependentUpon> | |||
| </Compile> | |||
| <Compile Include="ItemSelect.cs"> | |||
| <SubType>Form</SubType> | |||
| </Compile> | |||
| <Compile Include="ItemSelect.Designer.cs"> | |||
| <DependentUpon>ItemSelect.cs</DependentUpon> | |||
| </Compile> | |||
| <Compile Include="MainForm.cs"> | |||
| <SubType>Form</SubType> | |||
| </Compile> | |||
| <Compile Include="MainForm.Designer.cs"> | |||
| <DependentUpon>MainForm.cs</DependentUpon> | |||
| </Compile> | |||
| <Compile Include="Program.cs" /> | |||
| <Compile Include="Properties\AssemblyInfo.cs" /> | |||
| <Compile Include="ReadCardForm.cs"> | |||
| <SubType>Form</SubType> | |||
| </Compile> | |||
| <Compile Include="ReadCardForm.Designer.cs"> | |||
| <DependentUpon>ReadCardForm.cs</DependentUpon> | |||
| </Compile> | |||
| <Compile Include="SelfHelpForm.cs"> | |||
| <SubType>Form</SubType> | |||
| </Compile> | |||
| <Compile Include="SelfHelpForm.Designer.cs"> | |||
| <DependentUpon>SelfHelpForm.cs</DependentUpon> | |||
| </Compile> | |||
| <Compile Include="Utils\ClientRpc.cs" /> | |||
| <Compile Include="BO\WeightBill.cs" /> | |||
| <Compile Include="BO\WeightBill_FarmerDetail.cs" /> | |||
| <Compile Include="BO\WeightBill_WeightDetail.cs" /> | |||
| <Compile Include="WeightForm.cs"> | |||
| <SubType>Form</SubType> | |||
| </Compile> | |||
| <Compile Include="WeightForm.Designer.cs"> | |||
| <DependentUpon>WeightForm.cs</DependentUpon> | |||
| </Compile> | |||
| <EmbeddedResource Include="DialogForm.resx"> | |||
| <DependentUpon>DialogForm.cs</DependentUpon> | |||
| </EmbeddedResource> | |||
| <EmbeddedResource Include="ItemSelect.resx"> | |||
| <DependentUpon>ItemSelect.cs</DependentUpon> | |||
| </EmbeddedResource> | |||
| <EmbeddedResource Include="MainForm.resx"> | |||
| <DependentUpon>MainForm.cs</DependentUpon> | |||
| </EmbeddedResource> | |||
| <EmbeddedResource Include="Properties\Resources.resx"> | |||
| <Generator>ResXFileCodeGenerator</Generator> | |||
| <LastGenOutput>Resources.Designer.cs</LastGenOutput> | |||
| <SubType>Designer</SubType> | |||
| </EmbeddedResource> | |||
| <Compile Include="Properties\Resources.Designer.cs"> | |||
| <AutoGen>True</AutoGen> | |||
| <DependentUpon>Resources.resx</DependentUpon> | |||
| <DesignTime>True</DesignTime> | |||
| </Compile> | |||
| <EmbeddedResource Include="ReadCardForm.resx"> | |||
| <DependentUpon>ReadCardForm.cs</DependentUpon> | |||
| </EmbeddedResource> | |||
| <EmbeddedResource Include="SelfHelpForm.resx"> | |||
| <DependentUpon>SelfHelpForm.cs</DependentUpon> | |||
| </EmbeddedResource> | |||
| <EmbeddedResource Include="WeightForm.resx"> | |||
| <DependentUpon>WeightForm.cs</DependentUpon> | |||
| </EmbeddedResource> | |||
| <None Include="Properties\Settings.settings"> | |||
| <Generator>SettingsSingleFileGenerator</Generator> | |||
| <LastGenOutput>Settings.Designer.cs</LastGenOutput> | |||
| </None> | |||
| <Compile Include="Properties\Settings.Designer.cs"> | |||
| <AutoGen>True</AutoGen> | |||
| <DependentUpon>Settings.settings</DependentUpon> | |||
| <DesignTimeSharedInput>True</DesignTimeSharedInput> | |||
| </Compile> | |||
| </ItemGroup> | |||
| <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | |||
| <!-- To modify your build process, add your task inside one of the targets below and uncomment it. | |||
| Other similar extension points exist, see Microsoft.Common.targets. | |||
| <Target Name="BeforeBuild"> | |||
| </Target> | |||
| <Target Name="AfterBuild"> | |||
| </Target> | |||
| --> | |||
| </Project> | |||
| @ -0,0 +1,123 @@ | |||
| namespace SelfHelpClient | |||
| { | |||
| partial class SelfHelpForm | |||
| { | |||
| /// <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() | |||
| { | |||
| this.panel1 = new System.Windows.Forms.Panel(); | |||
| this.weightPrintBtn = new WinFormControl.NButton(); | |||
| this.washCarBtn = new WinFormControl.NButton(); | |||
| this.backBtn = new WinFormControl.NButton(); | |||
| this.panel1.SuspendLayout(); | |||
| this.SuspendLayout(); | |||
| // | |||
| // panel1 | |||
| // | |||
| this.panel1.Anchor = System.Windows.Forms.AnchorStyles.None; | |||
| this.panel1.Controls.Add(this.weightPrintBtn); | |||
| this.panel1.Controls.Add(this.washCarBtn); | |||
| this.panel1.Location = new System.Drawing.Point(136, 137); | |||
| this.panel1.Name = "panel1"; | |||
| this.panel1.Size = new System.Drawing.Size(644, 271); | |||
| this.panel1.TabIndex = 1; | |||
| // | |||
| // weightPrintBtn | |||
| // | |||
| this.weightPrintBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(136)))), ((int)(((byte)(255))))); | |||
| this.weightPrintBtn.ClickColor = System.Drawing.Color.YellowGreen; | |||
| this.weightPrintBtn.Font = new System.Drawing.Font("宋体", 23F); | |||
| this.weightPrintBtn.ForeColor = System.Drawing.Color.White; | |||
| this.weightPrintBtn.Location = new System.Drawing.Point(392, 64); | |||
| this.weightPrintBtn.Name = "weightPrintBtn"; | |||
| this.weightPrintBtn.PlaySound = true; | |||
| this.weightPrintBtn.Size = new System.Drawing.Size(235, 128); | |||
| this.weightPrintBtn.SoundType = WinFormControl.SoundType.Click; | |||
| this.weightPrintBtn.TabIndex = 1; | |||
| this.weightPrintBtn.Text = "打印过磅单"; | |||
| this.weightPrintBtn.ToColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(136)))), ((int)(((byte)(255))))); | |||
| this.weightPrintBtn.UseVisualStyleBackColor = false; | |||
| // | |||
| // washCarBtn | |||
| // | |||
| this.washCarBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(136)))), ((int)(((byte)(255))))); | |||
| this.washCarBtn.ClickColor = System.Drawing.Color.YellowGreen; | |||
| this.washCarBtn.Font = new System.Drawing.Font("宋体", 23F); | |||
| this.washCarBtn.ForeColor = System.Drawing.Color.White; | |||
| this.washCarBtn.Location = new System.Drawing.Point(23, 64); | |||
| this.washCarBtn.Name = "washCarBtn"; | |||
| this.washCarBtn.PlaySound = true; | |||
| this.washCarBtn.Size = new System.Drawing.Size(235, 128); | |||
| this.washCarBtn.SoundType = WinFormControl.SoundType.Click; | |||
| this.washCarBtn.TabIndex = 0; | |||
| this.washCarBtn.Text = "打印洗车单"; | |||
| this.washCarBtn.ToColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(136)))), ((int)(((byte)(255))))); | |||
| this.washCarBtn.UseVisualStyleBackColor = false; | |||
| // | |||
| // backBtn | |||
| // | |||
| this.backBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(136)))), ((int)(((byte)(255))))); | |||
| this.backBtn.ClickColor = System.Drawing.Color.YellowGreen; | |||
| this.backBtn.Font = new System.Drawing.Font("宋体", 18F); | |||
| this.backBtn.ForeColor = System.Drawing.Color.White; | |||
| this.backBtn.Location = new System.Drawing.Point(798, 12); | |||
| this.backBtn.Name = "backBtn"; | |||
| this.backBtn.PlaySound = false; | |||
| this.backBtn.Size = new System.Drawing.Size(113, 63); | |||
| this.backBtn.SoundType = WinFormControl.SoundType.Click; | |||
| this.backBtn.TabIndex = 3; | |||
| this.backBtn.TabStop = false; | |||
| this.backBtn.Text = "返回"; | |||
| this.backBtn.ToColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(136)))), ((int)(((byte)(255))))); | |||
| this.backBtn.UseVisualStyleBackColor = false; | |||
| this.backBtn.Click += new System.EventHandler(this.backBtn_Click); | |||
| // | |||
| // SelfHelpForm | |||
| // | |||
| this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); | |||
| this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; | |||
| this.BackColor = System.Drawing.Color.LightGray; | |||
| this.ClientSize = new System.Drawing.Size(923, 507); | |||
| this.Controls.Add(this.backBtn); | |||
| this.Controls.Add(this.panel1); | |||
| this.ForeColor = System.Drawing.SystemColors.ControlText; | |||
| this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; | |||
| this.Name = "SelfHelpForm"; | |||
| this.Text = "SelfHelpForm"; | |||
| this.WindowState = System.Windows.Forms.FormWindowState.Maximized; | |||
| this.panel1.ResumeLayout(false); | |||
| this.ResumeLayout(false); | |||
| } | |||
| #endregion | |||
| private System.Windows.Forms.Panel panel1; | |||
| private WinFormControl.NButton weightPrintBtn; | |||
| private WinFormControl.NButton washCarBtn; | |||
| private WinFormControl.NButton backBtn; | |||
| } | |||
| } | |||
| @ -0,0 +1,27 @@ | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.ComponentModel; | |||
| using System.Data; | |||
| using System.Drawing; | |||
| using System.Linq; | |||
| using System.Text; | |||
| using System.Threading; | |||
| using System.Threading.Tasks; | |||
| using System.Windows.Forms; | |||
| namespace SelfHelpClient | |||
| { | |||
| public partial class SelfHelpForm : Form | |||
| { | |||
| public SelfHelpForm(long id) | |||
| { | |||
| InitializeComponent(); | |||
| } | |||
| private void backBtn_Click(object sender, EventArgs e) | |||
| { | |||
| MainForm.Form.Show(); | |||
| this.Close(); | |||
| } | |||
| } | |||
| } | |||
| @ -0,0 +1,120 @@ | |||
| <?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> | |||
| </root> | |||
| @ -0,0 +1,124 @@ | |||
| using Newtonsoft.Json; | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.IO; | |||
| using System.Linq; | |||
| using System.Net; | |||
| using System.Text; | |||
| using System.Threading.Tasks; | |||
| namespace SelfHelpClient.Utils | |||
| { | |||
| public class ClientRpc | |||
| { | |||
| public ClientRpc(string url) | |||
| { | |||
| mUrl = url; | |||
| } | |||
| class _Error | |||
| { | |||
| public int? code { get; set; } | |||
| public string message { get; set; } | |||
| } | |||
| class _ErrorResposne | |||
| { | |||
| public _Error error { get; set; } | |||
| } | |||
| string mUrl; | |||
| public string Url | |||
| { | |||
| get | |||
| { | |||
| return mUrl; | |||
| } | |||
| } | |||
| public T Call<T>(string method, params object[] args) | |||
| { | |||
| var resp = DoCall<T>(method, args); | |||
| if (resp.error != null) | |||
| { | |||
| throw new Exception(string.Format("{0}:{1}", resp.error.code, resp.error.message)); | |||
| } | |||
| return resp.result; | |||
| } | |||
| LRestClientReponse<T> DoCall<T>(string method, object[] args) | |||
| { | |||
| var request = (HttpWebRequest)WebRequest.Create(mUrl); | |||
| request.Method = "POST"; | |||
| request.ContentType = "application/json"; | |||
| var dic = new Dictionary<string, object>(); | |||
| dic.Add("method", method); | |||
| dic.Add("id", 1); | |||
| dic.Add("params", args); | |||
| var json = JsonConvert.SerializeObject(dic); | |||
| var buffer = Encoding.UTF8.GetBytes(json); | |||
| var requestStream = request.GetRequestStream(); | |||
| requestStream.Write(buffer, 0, buffer.Length); | |||
| var responseJson = GetResponseJSON(request); | |||
| try | |||
| { | |||
| var result = JsonConvert.DeserializeObject<LRestClientReponse<T>>(responseJson); | |||
| return result; | |||
| } | |||
| catch | |||
| { | |||
| try | |||
| { | |||
| var errorResponse = JsonConvert.DeserializeObject<_ErrorResposne>(responseJson); | |||
| if (errorResponse.error != null) | |||
| { | |||
| throw new Exception(errorResponse.error.message); | |||
| } | |||
| } | |||
| catch | |||
| { | |||
| throw new Exception("JSON反序列化失败:" + responseJson); | |||
| } | |||
| throw new Exception("JSON反序列化失败:" + responseJson); | |||
| } | |||
| } | |||
| public class LRestClientReponseError | |||
| { | |||
| public string code { get; set; } | |||
| public string message { get; set; } | |||
| public override string ToString() | |||
| { | |||
| return string.Format("{0}:{1}", code, message); | |||
| } | |||
| } | |||
| public class LRestClientReponse<T> | |||
| { | |||
| public long id { get; set; } | |||
| public LRestClientReponseError error { get; set; } | |||
| public T result { get; set; } | |||
| } | |||
| private static string GetResponseJSON(HttpWebRequest request) | |||
| { | |||
| var response = request.GetResponse(); | |||
| using (var stream = response.GetResponseStream()) | |||
| { | |||
| using (var reader = new StreamReader(stream, Encoding.UTF8)) | |||
| { | |||
| return reader.ReadToEnd(); | |||
| } | |||
| } | |||
| } | |||
| } | |||
| } | |||
| @ -0,0 +1,400 @@ | |||
| namespace SelfHelpClient | |||
| { | |||
| partial class WeightForm | |||
| { | |||
| /// <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 dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); | |||
| System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); | |||
| System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle(); | |||
| System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = 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 dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); | |||
| System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); | |||
| System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); | |||
| this.panel1 = new System.Windows.Forms.Panel(); | |||
| this.backBtn = new WinFormControl.NButton(); | |||
| this.okBtn = new WinFormControl.NButton(); | |||
| this.panel2 = new System.Windows.Forms.Panel(); | |||
| this.groupBox2 = new System.Windows.Forms.GroupBox(); | |||
| this.weightGrid = new WinFormControl.UDataGridView(); | |||
| this.groupBox1 = new System.Windows.Forms.GroupBox(); | |||
| this.farmerGrid = new WinFormControl.UDataGridView(); | |||
| this.F_Index = new System.Windows.Forms.DataGridViewTextBoxColumn(); | |||
| this.F_Farmer_Name = new System.Windows.Forms.DataGridViewTextBoxColumn(); | |||
| this.F_Number = new System.Windows.Forms.DataGridViewTextBoxColumn(); | |||
| this.F_Weight = new System.Windows.Forms.DataGridViewTextBoxColumn(); | |||
| this.F_Money = new System.Windows.Forms.DataGridViewTextBoxColumn(); | |||
| this.F_Farmer_IDCard = new System.Windows.Forms.DataGridViewTextBoxColumn(); | |||
| this.F_Farmer_BankAccount = new System.Windows.Forms.DataGridViewTextBoxColumn(); | |||
| this.F_Farmer_Tel = new System.Windows.Forms.DataGridViewTextBoxColumn(); | |||
| this.F_Farmer_Address = new System.Windows.Forms.DataGridViewTextBoxColumn(); | |||
| this.D_Index = new System.Windows.Forms.DataGridViewTextBoxColumn(); | |||
| this.D_Number = new System.Windows.Forms.DataGridViewTextBoxColumn(); | |||
| this.D_MaoWeight = new System.Windows.Forms.DataGridViewTextBoxColumn(); | |||
| this.D_PiWeight = new System.Windows.Forms.DataGridViewTextBoxColumn(); | |||
| this.D_Weight = new System.Windows.Forms.DataGridViewTextBoxColumn(); | |||
| this.panel1.SuspendLayout(); | |||
| this.panel2.SuspendLayout(); | |||
| this.groupBox2.SuspendLayout(); | |||
| ((System.ComponentModel.ISupportInitialize)(this.weightGrid)).BeginInit(); | |||
| this.groupBox1.SuspendLayout(); | |||
| ((System.ComponentModel.ISupportInitialize)(this.farmerGrid)).BeginInit(); | |||
| this.SuspendLayout(); | |||
| // | |||
| // panel1 | |||
| // | |||
| this.panel1.Anchor = System.Windows.Forms.AnchorStyles.Bottom; | |||
| this.panel1.Controls.Add(this.backBtn); | |||
| this.panel1.Controls.Add(this.okBtn); | |||
| this.panel1.Location = new System.Drawing.Point(168, 394); | |||
| this.panel1.Name = "panel1"; | |||
| this.panel1.Size = new System.Drawing.Size(614, 100); | |||
| this.panel1.TabIndex = 0; | |||
| // | |||
| // backBtn | |||
| // | |||
| this.backBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(136)))), ((int)(((byte)(255))))); | |||
| this.backBtn.ClickColor = System.Drawing.Color.YellowGreen; | |||
| this.backBtn.Font = new System.Drawing.Font("宋体", 23F); | |||
| this.backBtn.ForeColor = System.Drawing.Color.White; | |||
| this.backBtn.Location = new System.Drawing.Point(352, 3); | |||
| this.backBtn.Name = "backBtn"; | |||
| this.backBtn.PlaySound = false; | |||
| this.backBtn.Size = new System.Drawing.Size(162, 94); | |||
| this.backBtn.SoundType = WinFormControl.SoundType.Click; | |||
| this.backBtn.TabIndex = 1; | |||
| this.backBtn.Text = "返回"; | |||
| this.backBtn.ToColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(136)))), ((int)(((byte)(255))))); | |||
| this.backBtn.UseVisualStyleBackColor = false; | |||
| this.backBtn.Click += new System.EventHandler(this.backBtn_Click); | |||
| // | |||
| // okBtn | |||
| // | |||
| this.okBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(136)))), ((int)(((byte)(255))))); | |||
| this.okBtn.ClickColor = System.Drawing.Color.YellowGreen; | |||
| this.okBtn.Font = new System.Drawing.Font("宋体", 23F); | |||
| this.okBtn.ForeColor = System.Drawing.Color.White; | |||
| this.okBtn.Location = new System.Drawing.Point(71, 3); | |||
| this.okBtn.Name = "okBtn"; | |||
| this.okBtn.PlaySound = false; | |||
| this.okBtn.Size = new System.Drawing.Size(162, 94); | |||
| this.okBtn.SoundType = WinFormControl.SoundType.Click; | |||
| this.okBtn.TabIndex = 0; | |||
| this.okBtn.Text = "确定"; | |||
| this.okBtn.ToColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(136)))), ((int)(((byte)(255))))); | |||
| this.okBtn.UseVisualStyleBackColor = false; | |||
| // | |||
| // panel2 | |||
| // | |||
| this.panel2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | |||
| | System.Windows.Forms.AnchorStyles.Left) | |||
| | System.Windows.Forms.AnchorStyles.Right))); | |||
| this.panel2.Controls.Add(this.groupBox2); | |||
| this.panel2.Controls.Add(this.groupBox1); | |||
| this.panel2.Location = new System.Drawing.Point(0, 12); | |||
| this.panel2.Name = "panel2"; | |||
| this.panel2.Size = new System.Drawing.Size(926, 362); | |||
| this.panel2.TabIndex = 1; | |||
| // | |||
| // groupBox2 | |||
| // | |||
| this.groupBox2.Controls.Add(this.weightGrid); | |||
| this.groupBox2.Location = new System.Drawing.Point(4, 230); | |||
| this.groupBox2.Name = "groupBox2"; | |||
| this.groupBox2.Size = new System.Drawing.Size(919, 108); | |||
| this.groupBox2.TabIndex = 1; | |||
| this.groupBox2.TabStop = false; | |||
| this.groupBox2.Text = "过磅信息"; | |||
| // | |||
| // weightGrid | |||
| // | |||
| this.weightGrid.AllowUserToAddRows = false; | |||
| this.weightGrid.AllowUserToDeleteRows = false; | |||
| this.weightGrid.AllowUserToResizeColumns = false; | |||
| this.weightGrid.AllowUserToResizeRows = false; | |||
| dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); | |||
| this.weightGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; | |||
| this.weightGrid.BackgroundColor = System.Drawing.Color.White; | |||
| this.weightGrid.BorderStyle = System.Windows.Forms.BorderStyle.None; | |||
| dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; | |||
| dataGridViewCellStyle2.Font = new System.Drawing.Font("宋体", 12F); | |||
| dataGridViewCellStyle2.ForeColor = System.Drawing.Color.White; | |||
| dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True; | |||
| this.weightGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2; | |||
| this.weightGrid.ColumnHeadersHeight = 40; | |||
| this.weightGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; | |||
| this.weightGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { | |||
| this.D_Index, | |||
| this.D_Number, | |||
| this.D_MaoWeight, | |||
| this.D_PiWeight, | |||
| this.D_Weight}); | |||
| this.weightGrid.Dock = System.Windows.Forms.DockStyle.Fill; | |||
| this.weightGrid.Location = new System.Drawing.Point(3, 17); | |||
| this.weightGrid.MultiSelect = false; | |||
| this.weightGrid.Name = "weightGrid"; | |||
| this.weightGrid.ReadOnly = true; | |||
| this.weightGrid.RowHeadersVisible = false; | |||
| dataGridViewCellStyle6.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); | |||
| dataGridViewCellStyle6.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); | |||
| this.weightGrid.RowsDefaultCellStyle = dataGridViewCellStyle6; | |||
| this.weightGrid.RowTemplate.Height = 30; | |||
| this.weightGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; | |||
| this.weightGrid.Size = new System.Drawing.Size(913, 88); | |||
| this.weightGrid.TabIndex = 0; | |||
| // | |||
| // groupBox1 | |||
| // | |||
| this.groupBox1.Controls.Add(this.farmerGrid); | |||
| this.groupBox1.Location = new System.Drawing.Point(4, 78); | |||
| this.groupBox1.Name = "groupBox1"; | |||
| this.groupBox1.Size = new System.Drawing.Size(920, 109); | |||
| this.groupBox1.TabIndex = 0; | |||
| this.groupBox1.TabStop = false; | |||
| this.groupBox1.Text = "养殖户信息"; | |||
| // | |||
| // farmerGrid | |||
| // | |||
| this.farmerGrid.AllowUserToAddRows = false; | |||
| this.farmerGrid.AllowUserToDeleteRows = false; | |||
| this.farmerGrid.AllowUserToResizeColumns = false; | |||
| this.farmerGrid.AllowUserToResizeRows = false; | |||
| dataGridViewCellStyle7.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); | |||
| this.farmerGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle7; | |||
| this.farmerGrid.BackgroundColor = System.Drawing.Color.White; | |||
| this.farmerGrid.BorderStyle = System.Windows.Forms.BorderStyle.None; | |||
| dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; | |||
| dataGridViewCellStyle8.Font = new System.Drawing.Font("宋体", 12F); | |||
| dataGridViewCellStyle8.ForeColor = System.Drawing.Color.White; | |||
| dataGridViewCellStyle8.WrapMode = System.Windows.Forms.DataGridViewTriState.True; | |||
| this.farmerGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle8; | |||
| this.farmerGrid.ColumnHeadersHeight = 40; | |||
| this.farmerGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; | |||
| this.farmerGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { | |||
| this.F_Index, | |||
| this.F_Farmer_Name, | |||
| this.F_Number, | |||
| this.F_Weight, | |||
| this.F_Money, | |||
| this.F_Farmer_IDCard, | |||
| this.F_Farmer_BankAccount, | |||
| this.F_Farmer_Tel, | |||
| this.F_Farmer_Address}); | |||
| this.farmerGrid.Dock = System.Windows.Forms.DockStyle.Fill; | |||
| this.farmerGrid.Location = new System.Drawing.Point(3, 17); | |||
| this.farmerGrid.MultiSelect = false; | |||
| this.farmerGrid.Name = "farmerGrid"; | |||
| this.farmerGrid.ReadOnly = true; | |||
| this.farmerGrid.RowHeadersVisible = false; | |||
| dataGridViewCellStyle11.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); | |||
| dataGridViewCellStyle11.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); | |||
| this.farmerGrid.RowsDefaultCellStyle = dataGridViewCellStyle11; | |||
| this.farmerGrid.RowTemplate.Height = 30; | |||
| this.farmerGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; | |||
| this.farmerGrid.Size = new System.Drawing.Size(914, 89); | |||
| this.farmerGrid.TabIndex = 0; | |||
| // | |||
| // F_Index | |||
| // | |||
| this.F_Index.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; | |||
| this.F_Index.DataPropertyName = "Index"; | |||
| this.F_Index.HeaderText = "序号"; | |||
| this.F_Index.MinimumWidth = 70; | |||
| this.F_Index.Name = "F_Index"; | |||
| this.F_Index.ReadOnly = true; | |||
| this.F_Index.Width = 70; | |||
| // | |||
| // F_Farmer_Name | |||
| // | |||
| this.F_Farmer_Name.DataPropertyName = "Farmer_Name"; | |||
| this.F_Farmer_Name.HeaderText = "养殖户"; | |||
| this.F_Farmer_Name.Name = "F_Farmer_Name"; | |||
| this.F_Farmer_Name.ReadOnly = true; | |||
| this.F_Farmer_Name.Width = 150; | |||
| // | |||
| // F_Number | |||
| // | |||
| this.F_Number.DataPropertyName = "Number"; | |||
| this.F_Number.HeaderText = "头数"; | |||
| this.F_Number.Name = "F_Number"; | |||
| this.F_Number.ReadOnly = true; | |||
| this.F_Number.Width = 80; | |||
| // | |||
| // F_Weight | |||
| // | |||
| this.F_Weight.DataPropertyName = "Weight"; | |||
| dataGridViewCellStyle9.Format = "#0.######"; | |||
| this.F_Weight.DefaultCellStyle = dataGridViewCellStyle9; | |||
| this.F_Weight.HeaderText = "重量"; | |||
| this.F_Weight.Name = "F_Weight"; | |||
| this.F_Weight.ReadOnly = true; | |||
| // | |||
| // F_Money | |||
| // | |||
| this.F_Money.DataPropertyName = "Money"; | |||
| dataGridViewCellStyle10.Format = "#0.######"; | |||
| this.F_Money.DefaultCellStyle = dataGridViewCellStyle10; | |||
| this.F_Money.HeaderText = "棚前金额"; | |||
| this.F_Money.Name = "F_Money"; | |||
| this.F_Money.ReadOnly = true; | |||
| this.F_Money.Width = 120; | |||
| // | |||
| // F_Farmer_IDCard | |||
| // | |||
| this.F_Farmer_IDCard.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; | |||
| this.F_Farmer_IDCard.DataPropertyName = "Farmer_IDCard"; | |||
| this.F_Farmer_IDCard.HeaderText = "身份证号"; | |||
| this.F_Farmer_IDCard.MinimumWidth = 150; | |||
| this.F_Farmer_IDCard.Name = "F_Farmer_IDCard"; | |||
| this.F_Farmer_IDCard.ReadOnly = true; | |||
| this.F_Farmer_IDCard.Width = 150; | |||
| // | |||
| // F_Farmer_BankAccount | |||
| // | |||
| this.F_Farmer_BankAccount.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; | |||
| this.F_Farmer_BankAccount.DataPropertyName = "Farmer_BankAccount"; | |||
| this.F_Farmer_BankAccount.HeaderText = "银行卡号"; | |||
| this.F_Farmer_BankAccount.MinimumWidth = 150; | |||
| this.F_Farmer_BankAccount.Name = "F_Farmer_BankAccount"; | |||
| this.F_Farmer_BankAccount.ReadOnly = true; | |||
| this.F_Farmer_BankAccount.Width = 150; | |||
| // | |||
| // F_Farmer_Tel | |||
| // | |||
| this.F_Farmer_Tel.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; | |||
| this.F_Farmer_Tel.DataPropertyName = "Farmer_Tel"; | |||
| this.F_Farmer_Tel.HeaderText = "手机"; | |||
| this.F_Farmer_Tel.MinimumWidth = 150; | |||
| this.F_Farmer_Tel.Name = "F_Farmer_Tel"; | |||
| this.F_Farmer_Tel.ReadOnly = true; | |||
| this.F_Farmer_Tel.Width = 150; | |||
| // | |||
| // F_Farmer_Address | |||
| // | |||
| this.F_Farmer_Address.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; | |||
| this.F_Farmer_Address.DataPropertyName = "Farmer_Address"; | |||
| this.F_Farmer_Address.HeaderText = "地址"; | |||
| this.F_Farmer_Address.MinimumWidth = 150; | |||
| this.F_Farmer_Address.Name = "F_Farmer_Address"; | |||
| this.F_Farmer_Address.ReadOnly = true; | |||
| // | |||
| // D_Index | |||
| // | |||
| this.D_Index.DataPropertyName = "Index"; | |||
| this.D_Index.HeaderText = "序号"; | |||
| this.D_Index.Name = "D_Index"; | |||
| this.D_Index.ReadOnly = true; | |||
| // | |||
| // D_Number | |||
| // | |||
| this.D_Number.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; | |||
| this.D_Number.DataPropertyName = "Number"; | |||
| this.D_Number.HeaderText = "头数"; | |||
| this.D_Number.Name = "D_Number"; | |||
| this.D_Number.ReadOnly = true; | |||
| // | |||
| // D_MaoWeight | |||
| // | |||
| this.D_MaoWeight.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; | |||
| this.D_MaoWeight.DataPropertyName = "MaoWeight"; | |||
| dataGridViewCellStyle3.Format = "#0.######"; | |||
| this.D_MaoWeight.DefaultCellStyle = dataGridViewCellStyle3; | |||
| this.D_MaoWeight.HeaderText = "毛重"; | |||
| this.D_MaoWeight.Name = "D_MaoWeight"; | |||
| this.D_MaoWeight.ReadOnly = true; | |||
| // | |||
| // D_PiWeight | |||
| // | |||
| this.D_PiWeight.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; | |||
| this.D_PiWeight.DataPropertyName = "PiWeight"; | |||
| dataGridViewCellStyle4.Format = "#0.######"; | |||
| this.D_PiWeight.DefaultCellStyle = dataGridViewCellStyle4; | |||
| this.D_PiWeight.HeaderText = "皮重"; | |||
| this.D_PiWeight.Name = "D_PiWeight"; | |||
| this.D_PiWeight.ReadOnly = true; | |||
| // | |||
| // D_Weight | |||
| // | |||
| this.D_Weight.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; | |||
| this.D_Weight.DataPropertyName = "Weight"; | |||
| dataGridViewCellStyle5.Format = "#0.######"; | |||
| this.D_Weight.DefaultCellStyle = dataGridViewCellStyle5; | |||
| this.D_Weight.HeaderText = "重量"; | |||
| this.D_Weight.Name = "D_Weight"; | |||
| this.D_Weight.ReadOnly = true; | |||
| // | |||
| // WeightForm | |||
| // | |||
| this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); | |||
| this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; | |||
| this.ClientSize = new System.Drawing.Size(926, 514); | |||
| this.Controls.Add(this.panel2); | |||
| this.Controls.Add(this.panel1); | |||
| this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; | |||
| this.Name = "WeightForm"; | |||
| this.Text = "WeightForm"; | |||
| this.WindowState = System.Windows.Forms.FormWindowState.Maximized; | |||
| this.panel1.ResumeLayout(false); | |||
| this.panel2.ResumeLayout(false); | |||
| this.groupBox2.ResumeLayout(false); | |||
| ((System.ComponentModel.ISupportInitialize)(this.weightGrid)).EndInit(); | |||
| this.groupBox1.ResumeLayout(false); | |||
| ((System.ComponentModel.ISupportInitialize)(this.farmerGrid)).EndInit(); | |||
| this.ResumeLayout(false); | |||
| } | |||
| #endregion | |||
| private System.Windows.Forms.Panel panel1; | |||
| private WinFormControl.NButton backBtn; | |||
| private WinFormControl.NButton okBtn; | |||
| private System.Windows.Forms.Panel panel2; | |||
| private System.Windows.Forms.GroupBox groupBox1; | |||
| private System.Windows.Forms.GroupBox groupBox2; | |||
| private WinFormControl.UDataGridView farmerGrid; | |||
| private WinFormControl.UDataGridView weightGrid; | |||
| private System.Windows.Forms.DataGridViewTextBoxColumn F_Index; | |||
| private System.Windows.Forms.DataGridViewTextBoxColumn F_Farmer_Name; | |||
| private System.Windows.Forms.DataGridViewTextBoxColumn F_Number; | |||
| private System.Windows.Forms.DataGridViewTextBoxColumn F_Weight; | |||
| private System.Windows.Forms.DataGridViewTextBoxColumn F_Money; | |||
| private System.Windows.Forms.DataGridViewTextBoxColumn F_Farmer_IDCard; | |||
| private System.Windows.Forms.DataGridViewTextBoxColumn F_Farmer_BankAccount; | |||
| private System.Windows.Forms.DataGridViewTextBoxColumn F_Farmer_Tel; | |||
| private System.Windows.Forms.DataGridViewTextBoxColumn F_Farmer_Address; | |||
| private System.Windows.Forms.DataGridViewTextBoxColumn D_Index; | |||
| private System.Windows.Forms.DataGridViewTextBoxColumn D_Number; | |||
| private System.Windows.Forms.DataGridViewTextBoxColumn D_MaoWeight; | |||
| private System.Windows.Forms.DataGridViewTextBoxColumn D_PiWeight; | |||
| private System.Windows.Forms.DataGridViewTextBoxColumn D_Weight; | |||
| } | |||
| } | |||
| @ -0,0 +1,190 @@ | |||
| using SelfHelpClient.BL; | |||
| using SelfHelpClient.BO; | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.ComponentModel; | |||
| using System.Data; | |||
| using System.Drawing; | |||
| using System.Linq; | |||
| using System.Text; | |||
| using System.Threading; | |||
| using System.Threading.Tasks; | |||
| using System.Windows.Forms; | |||
| namespace SelfHelpClient | |||
| { | |||
| public partial class WeightForm : Form | |||
| { | |||
| WeightBill entity; | |||
| Thread refersh; | |||
| public WeightForm(ViewEntity view) | |||
| { | |||
| InitializeComponent(); | |||
| if (view.BillType == 0) | |||
| entity = WeightBillBL.CreateWeightBill(view.ID); | |||
| else | |||
| entity = WeightBillBL.GetWeightBill(view.ID); | |||
| var tableHeight = InitTableLayoutPanel(); | |||
| BuildGridPanel(tableHeight); | |||
| this.FormClosing += delegate | |||
| { | |||
| if (refersh != null && refersh.IsAlive) | |||
| refersh.Abort(); | |||
| }; | |||
| } | |||
| protected override void OnLoad(EventArgs e) | |||
| { | |||
| base.OnLoad(e); | |||
| farmerGrid.DataSource = entity.FarmerDetails; | |||
| farmerGrid.Refresh(); | |||
| weightGrid.DataSource = entity.Details; | |||
| weightGrid.Refresh(); | |||
| refersh = new Thread(RefershDetail); | |||
| refersh.Start(); | |||
| } | |||
| private void RefershDetail() | |||
| { | |||
| while (true) | |||
| { | |||
| Thread.Sleep(2000); | |||
| if (this.IsHandleCreated) | |||
| { | |||
| this.Invoke(new Action(() => | |||
| { | |||
| var detail = WeightBillBL.GetWeightDetail(entity.ID); | |||
| if (detail.Any()) | |||
| { | |||
| weightGrid.DataSource = detail; | |||
| weightGrid.Refresh(); | |||
| } | |||
| })); | |||
| } | |||
| } | |||
| } | |||
| private void BuildGridPanel(int tableHeight) | |||
| { | |||
| groupBox1.Location = new Point(0, tableHeight + 10); | |||
| groupBox1.Width = Screen.PrimaryScreen.Bounds.Width; | |||
| groupBox1.Height = 200; | |||
| groupBox2.Location = new Point(0, tableHeight + groupBox1.Height + 10); | |||
| groupBox2.Width = Screen.PrimaryScreen.Bounds.Width; | |||
| groupBox2.Height = 150; | |||
| } | |||
| private int InitTableLayoutPanel() | |||
| { | |||
| TableLayoutPanel tablePanel = new TableLayoutPanel(); | |||
| tablePanel.Width = Screen.PrimaryScreen.Bounds.Width; | |||
| panel2.Controls.Add(tablePanel); | |||
| var dic = BuildFields(); | |||
| var table = ComputeColAndRow(dic.Count); | |||
| tablePanel.Height = 60 * table.Rows + 5; | |||
| DynamicLayout(tablePanel, table); | |||
| var type = typeof(WeightBill); | |||
| var r = 0; | |||
| var c = 0; | |||
| foreach (var item in dic) | |||
| { | |||
| Label title = BuildLabel(item.Value + ":"); | |||
| tablePanel.Controls.Add(title); | |||
| tablePanel.SetRow(title, r); | |||
| tablePanel.SetColumn(title, c); | |||
| c++; | |||
| var v = type.GetProperty(item.Key).GetValue(entity); | |||
| var lbl = string.Empty; | |||
| switch (item.Key) | |||
| { | |||
| case "WeighTime": | |||
| lbl = string.Format("{0:yyyy-MM-dd HH:mm:ss}", v); | |||
| break; | |||
| case "JingJianFee": | |||
| case "DiscontMoney": | |||
| case "ShackWeight": | |||
| case "ShackPrice": | |||
| case "ShackMoney": | |||
| lbl = string.Format("{0:#0.######}", v); | |||
| break; | |||
| case "AnimalTestDate": | |||
| lbl = string.Format("{0:yyyy-MM-dd}", v); | |||
| break; | |||
| default: | |||
| lbl = string.Format("{0}", v); | |||
| break; | |||
| } | |||
| Label content = BuildLabel(lbl); | |||
| tablePanel.Controls.Add(content); | |||
| tablePanel.SetRow(content, r); | |||
| tablePanel.SetColumn(content, c); | |||
| c++; | |||
| if (c % table.Cols == 0) | |||
| { | |||
| c = 0; | |||
| r++; | |||
| } | |||
| } | |||
| return tablePanel.Height; | |||
| } | |||
| TableSturct ComputeColAndRow(int fileCount) | |||
| { | |||
| var screenWidth = Screen.PrimaryScreen.Bounds.Width; | |||
| var col = Math.Floor((decimal)screenWidth / (160 + 280)); | |||
| var row = Math.Ceiling(fileCount / col); | |||
| return new TableSturct() { Rows = (int)row, Cols = (int)col * 2 }; | |||
| } | |||
| private void DynamicLayout(TableLayoutPanel layoutPanel, TableSturct table) | |||
| { | |||
| layoutPanel.RowCount = table.Rows; //设置分成几行 | |||
| for (int i = 0; i < table.Rows; i++) | |||
| { | |||
| layoutPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, 60)); | |||
| } | |||
| layoutPanel.ColumnCount = table.Cols; //设置分成几列 | |||
| for (int i = 0; i < table.Cols; i++) | |||
| { | |||
| var precent = i % 2 == 0 ? 30F : 70F; | |||
| layoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, precent)); | |||
| } | |||
| } | |||
| Dictionary<string, string> BuildFields() | |||
| { | |||
| var dic = new Dictionary<string, string>() { | |||
| {"Supplier_Name","供应商"},{"PurchaseType_Name","收购类型"},{"WeighTime","过磅时间"},{"Car_Name","车辆"},{"Employee_Name","业务员"},{"JingJianFee","经检费"},{"DiscontMoney","猪场扣款"},{"ShackWeight","棚前重量"},{"ShackPrice","棚前单价"},{"ShackMoney","棚前金额"},{"AnimalTestMan","动检人"},{"AnimalTestNumber","动检证号"},{"AnimalTestDate","动检日期"}, | |||
| }; | |||
| return dic; | |||
| } | |||
| Label BuildLabel(string content) | |||
| { | |||
| Label label = new Label(); | |||
| label.Text = content; | |||
| label.Font = new System.Drawing.Font("宋体", 18); | |||
| label.Dock = DockStyle.Fill; | |||
| label.TextAlign = ContentAlignment.MiddleLeft; | |||
| return label; | |||
| } | |||
| private void backBtn_Click(object sender, EventArgs e) | |||
| { | |||
| MainForm.Form.Show(); | |||
| this.Close(); | |||
| } | |||
| } | |||
| struct TableSturct | |||
| { | |||
| public int Rows { get; set; } | |||
| public int Cols { get; set; } | |||
| } | |||
| } | |||
| @ -0,0 +1,162 @@ | |||
| <?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="D_Index.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
| <value>True</value> | |||
| </metadata> | |||
| <metadata name="D_Number.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
| <value>True</value> | |||
| </metadata> | |||
| <metadata name="D_MaoWeight.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
| <value>True</value> | |||
| </metadata> | |||
| <metadata name="D_PiWeight.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
| <value>True</value> | |||
| </metadata> | |||
| <metadata name="D_Weight.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
| <value>True</value> | |||
| </metadata> | |||
| <metadata name="F_Index.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
| <value>True</value> | |||
| </metadata> | |||
| <metadata name="F_Farmer_Name.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
| <value>True</value> | |||
| </metadata> | |||
| <metadata name="F_Number.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
| <value>True</value> | |||
| </metadata> | |||
| <metadata name="F_Weight.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
| <value>True</value> | |||
| </metadata> | |||
| <metadata name="F_Money.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
| <value>True</value> | |||
| </metadata> | |||
| <metadata name="F_Farmer_IDCard.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
| <value>True</value> | |||
| </metadata> | |||
| <metadata name="F_Farmer_BankAccount.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
| <value>True</value> | |||
| </metadata> | |||
| <metadata name="F_Farmer_Tel.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
| <value>True</value> | |||
| </metadata> | |||
| <metadata name="F_Farmer_Address.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
| <value>True</value> | |||
| </metadata> | |||
| </root> | |||