Browse Source

..客户端功能完善

master
robin 8 years ago
parent
commit
41e8b4c539
5 changed files with 138 additions and 72 deletions
  1. +8
    -2
      B3ButcherWeightClient/ConfigUtil.cs
  2. +74
    -58
      B3ButcherWeightClient/Main.Designer.cs
  3. +21
    -7
      B3ButcherWeightClient/Main.cs
  4. +26
    -3
      B3ButcherWeightClient/Parameters.Designer.cs
  5. +9
    -2
      B3ButcherWeightClient/Parameters.cs

+ 8
- 2
B3ButcherWeightClient/ConfigUtil.cs View File

@ -110,7 +110,12 @@ namespace B3ButcherWeightClient {
} else { } else {
long.TryParse(str, out ShengchanID); long.TryParse(str, out ShengchanID);
} }
str = nutFile.AsString(ConfigItem.BanKuaiID, "");
if (string.IsNullOrEmpty(str)) {
BanKuaiID = 0;
} else {
long.TryParse(str, out BanKuaiID);
}
} }
} }
@ -162,7 +167,7 @@ namespace B3ButcherWeightClient {
public static long StoreID; public static long StoreID;
public static long TouruID; public static long TouruID;
public static long ShengchanID; public static long ShengchanID;
public static long BanKuaiID;
} }
public class ConfigItem { public class ConfigItem {
@ -201,5 +206,6 @@ namespace B3ButcherWeightClient {
public const string StoreID = "StoreID"; public const string StoreID = "StoreID";
public const string TouruID = "TouruID"; public const string TouruID = "TouruID";
public const string ShengchanID = "ShengchanID"; public const string ShengchanID = "ShengchanID";
public const string BanKuaiID = "BanKuaiID";
} }
} }

+ 74
- 58
B3ButcherWeightClient/Main.Designer.cs View File

@ -59,13 +59,13 @@ namespace B3ButcherWeightClient {
this.Weight = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Weight = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.DeleteDetail = new System.Windows.Forms.DataGridViewButtonColumn(); this.DeleteDetail = new System.Windows.Forms.DataGridViewButtonColumn();
this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.button3 = new System.Windows.Forms.Button();
this.button1 = new System.Windows.Forms.Button(); this.button1 = new System.Windows.Forms.Button();
this.pictureBox2 = new System.Windows.Forms.PictureBox();
this.monthCalendar = new System.Windows.Forms.MonthCalendar();
this.groupBox2 = new System.Windows.Forms.GroupBox(); this.groupBox2 = new System.Windows.Forms.GroupBox();
this.setButton = new System.Windows.Forms.Button(); this.setButton = new System.Windows.Forms.Button();
this.textBoxEndTime = new System.Windows.Forms.TextBox(); this.textBoxEndTime = new System.Windows.Forms.TextBox();
this.button2 = new System.Windows.Forms.Button(); this.button2 = new System.Windows.Forms.Button();
this.pictureBox2 = new System.Windows.Forms.PictureBox();
this.textBoxBeginTime = new System.Windows.Forms.TextBox(); this.textBoxBeginTime = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label(); this.label5 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label(); this.label6 = new System.Windows.Forms.Label();
@ -83,16 +83,18 @@ namespace B3ButcherWeightClient {
this.label4 = new System.Windows.Forms.Label(); this.label4 = new System.Windows.Forms.Label();
this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.panel1 = new System.Windows.Forms.Panel(); this.panel1 = new System.Windows.Forms.Panel();
this.monthCalendar = new System.Windows.Forms.MonthCalendar();
this._serialPort = new System.IO.Ports.SerialPort(this.components); this._serialPort = new System.IO.Ports.SerialPort(this.components);
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout(); this.splitContainer1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
this.groupBox2.SuspendLayout(); this.groupBox2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
this.groupBox1.SuspendLayout(); this.groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.panel1.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// lblDisplay // lblDisplay
@ -104,9 +106,8 @@ namespace B3ButcherWeightClient {
this.lblDisplay.ForeColor = System.Drawing.Color.LimeGreen; this.lblDisplay.ForeColor = System.Drawing.Color.LimeGreen;
this.lblDisplay.Location = new System.Drawing.Point(3, 0); this.lblDisplay.Location = new System.Drawing.Point(3, 0);
this.lblDisplay.Name = "lblDisplay"; this.lblDisplay.Name = "lblDisplay";
this.lblDisplay.Size = new System.Drawing.Size(530, 64);
this.lblDisplay.Size = new System.Drawing.Size(291, 64);
this.lblDisplay.TabIndex = 3; this.lblDisplay.TabIndex = 3;
this.lblDisplay.Text = "display";
this.lblDisplay.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.lblDisplay.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
// //
// dataGridView // dataGridView
@ -141,7 +142,7 @@ namespace B3ButcherWeightClient {
this.dataGridView.Name = "dataGridView"; this.dataGridView.Name = "dataGridView";
this.dataGridView.ReadOnly = true; this.dataGridView.ReadOnly = true;
this.dataGridView.RowTemplate.Height = 23; this.dataGridView.RowTemplate.Height = 23;
this.dataGridView.Size = new System.Drawing.Size(716, 675);
this.dataGridView.Size = new System.Drawing.Size(583, 695);
this.dataGridView.TabIndex = 4; this.dataGridView.TabIndex = 4;
this.dataGridView.TabStop = false; this.dataGridView.TabStop = false;
this.dataGridView.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.DataGridViewCellContentClick); this.dataGridView.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.DataGridViewCellContentClick);
@ -259,27 +260,37 @@ namespace B3ButcherWeightClient {
// splitContainer1.Panel1 // splitContainer1.Panel1
// //
this.splitContainer1.Panel1.BackColor = System.Drawing.Color.White; this.splitContainer1.Panel1.BackColor = System.Drawing.Color.White;
this.splitContainer1.Panel1.Controls.Add(this.button3);
this.splitContainer1.Panel1.Controls.Add(this.button1); this.splitContainer1.Panel1.Controls.Add(this.button1);
this.splitContainer1.Panel1.Controls.Add(this.lblDisplay); this.splitContainer1.Panel1.Controls.Add(this.lblDisplay);
this.splitContainer1.Panel1.Controls.Add(this.pictureBox2);
this.splitContainer1.Panel1.Controls.Add(this.dataGridView); this.splitContainer1.Panel1.Controls.Add(this.dataGridView);
// //
// splitContainer1.Panel2 // splitContainer1.Panel2
// //
this.splitContainer1.Panel2.BackColor = System.Drawing.Color.White; this.splitContainer1.Panel2.BackColor = System.Drawing.Color.White;
this.splitContainer1.Panel2.Controls.Add(this.monthCalendar);
this.splitContainer1.Panel2.Controls.Add(this.groupBox2); this.splitContainer1.Panel2.Controls.Add(this.groupBox2);
this.splitContainer1.Panel2.Controls.Add(this.groupBox1); this.splitContainer1.Panel2.Controls.Add(this.groupBox1);
this.splitContainer1.Panel2.Controls.Add(this.pictureBox1); this.splitContainer1.Panel2.Controls.Add(this.pictureBox1);
this.splitContainer1.Panel2.Controls.Add(this.panel1); this.splitContainer1.Panel2.Controls.Add(this.panel1);
this.splitContainer1.Size = new System.Drawing.Size(1387, 748);
this.splitContainer1.SplitterDistance = 722;
this.splitContainer1.Size = new System.Drawing.Size(1184, 768);
this.splitContainer1.SplitterDistance = 589;
this.splitContainer1.TabIndex = 6; this.splitContainer1.TabIndex = 6;
// //
// button3
//
this.button3.Font = new System.Drawing.Font("宋体", 21.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button3.Location = new System.Drawing.Point(446, 5);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(140, 58);
this.button3.TabIndex = 22;
this.button3.Text = "退 出";
this.button3.UseVisualStyleBackColor = true;
this.button3.Click += new System.EventHandler(this.button3_Click);
//
// button1 // button1
// //
this.button1.Font = new System.Drawing.Font("宋体", 24F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button1.Location = new System.Drawing.Point(579, 3);
this.button1.Font = new System.Drawing.Font("宋体", 21.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button1.Location = new System.Drawing.Point(300, 3);
this.button1.Name = "button1"; this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(140, 58); this.button1.Size = new System.Drawing.Size(140, 58);
this.button1.TabIndex = 5; this.button1.TabIndex = 5;
@ -287,43 +298,26 @@ namespace B3ButcherWeightClient {
this.button1.UseVisualStyleBackColor = true; this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click); this.button1.Click += new System.EventHandler(this.button1_Click);
// //
// pictureBox2
//
this.pictureBox2.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox2.Image")));
this.pictureBox2.Location = new System.Drawing.Point(539, 3);
this.pictureBox2.Name = "pictureBox2";
this.pictureBox2.Size = new System.Drawing.Size(34, 29);
this.pictureBox2.TabIndex = 18;
this.pictureBox2.TabStop = false;
this.pictureBox2.Visible = false;
this.pictureBox2.Click += new System.EventHandler(this.pictureBox2_Click);
//
// monthCalendar
//
this.monthCalendar.Location = new System.Drawing.Point(196, 158);
this.monthCalendar.Name = "monthCalendar";
this.monthCalendar.TabIndex = 7;
this.monthCalendar.DateChanged += new System.Windows.Forms.DateRangeEventHandler(this.monthCalendar_DateSelected);
//
// groupBox2 // groupBox2
// //
this.groupBox2.Controls.Add(this.setButton); this.groupBox2.Controls.Add(this.setButton);
this.groupBox2.Controls.Add(this.textBoxEndTime); this.groupBox2.Controls.Add(this.textBoxEndTime);
this.groupBox2.Controls.Add(this.button2); this.groupBox2.Controls.Add(this.button2);
this.groupBox2.Controls.Add(this.pictureBox2);
this.groupBox2.Controls.Add(this.textBoxBeginTime); this.groupBox2.Controls.Add(this.textBoxBeginTime);
this.groupBox2.Controls.Add(this.label5); this.groupBox2.Controls.Add(this.label5);
this.groupBox2.Controls.Add(this.label6); this.groupBox2.Controls.Add(this.label6);
this.groupBox2.Location = new System.Drawing.Point(3, 105); this.groupBox2.Location = new System.Drawing.Point(3, 105);
this.groupBox2.Name = "groupBox2"; this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(655, 97);
this.groupBox2.Size = new System.Drawing.Size(585, 97);
this.groupBox2.TabIndex = 0; this.groupBox2.TabIndex = 0;
this.groupBox2.TabStop = false; this.groupBox2.TabStop = false;
this.groupBox2.Text = "创建单据"; this.groupBox2.Text = "创建单据";
// //
// setButton // setButton
// //
this.setButton.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.setButton.Location = new System.Drawing.Point(492, 8);
this.setButton.Font = new System.Drawing.Font("宋体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.setButton.Location = new System.Drawing.Point(425, 13);
this.setButton.Name = "setButton"; this.setButton.Name = "setButton";
this.setButton.Size = new System.Drawing.Size(154, 37); this.setButton.Size = new System.Drawing.Size(154, 37);
this.setButton.TabIndex = 19; this.setButton.TabIndex = 19;
@ -334,19 +328,19 @@ namespace B3ButcherWeightClient {
// textBoxEndTime // textBoxEndTime
// //
this.textBoxEndTime.Font = new System.Drawing.Font("宋体", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.textBoxEndTime.Font = new System.Drawing.Font("宋体", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.textBoxEndTime.Location = new System.Drawing.Point(313, 11);
this.textBoxEndTime.Location = new System.Drawing.Point(275, 54);
this.textBoxEndTime.MaxLength = 20; this.textBoxEndTime.MaxLength = 20;
this.textBoxEndTime.Multiline = true; this.textBoxEndTime.Multiline = true;
this.textBoxEndTime.Name = "textBoxEndTime"; this.textBoxEndTime.Name = "textBoxEndTime";
this.textBoxEndTime.Size = new System.Drawing.Size(165, 30);
this.textBoxEndTime.Size = new System.Drawing.Size(124, 30);
this.textBoxEndTime.TabIndex = 13; this.textBoxEndTime.TabIndex = 13;
this.textBoxEndTime.TabStop = false;
this.textBoxEndTime.TabStop = false;
this.textBoxEndTime.DoubleClick += new System.EventHandler(this.textBoxEndTime_DoubleClick); this.textBoxEndTime.DoubleClick += new System.EventHandler(this.textBoxEndTime_DoubleClick);
// //
// button2 // button2
// //
this.button2.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.button2.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button2.Location = new System.Drawing.Point(492, 51);
this.button2.Location = new System.Drawing.Point(425, 54);
this.button2.Name = "button2"; this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(154, 37); this.button2.Size = new System.Drawing.Size(154, 37);
this.button2.TabIndex = 21; this.button2.TabIndex = 21;
@ -354,14 +348,25 @@ namespace B3ButcherWeightClient {
this.button2.UseVisualStyleBackColor = true; this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click); this.button2.Click += new System.EventHandler(this.button2_Click);
// //
// pictureBox2
//
this.pictureBox2.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox2.Image")));
this.pictureBox2.Location = new System.Drawing.Point(10, 20);
this.pictureBox2.Name = "pictureBox2";
this.pictureBox2.Size = new System.Drawing.Size(34, 29);
this.pictureBox2.TabIndex = 18;
this.pictureBox2.TabStop = false;
this.pictureBox2.Visible = false;
this.pictureBox2.Click += new System.EventHandler(this.pictureBox2_Click);
//
// textBoxBeginTime // textBoxBeginTime
// //
this.textBoxBeginTime.Font = new System.Drawing.Font("宋体", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.textBoxBeginTime.Font = new System.Drawing.Font("宋体", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.textBoxBeginTime.Location = new System.Drawing.Point(107, 11);
this.textBoxBeginTime.Location = new System.Drawing.Point(110, 53);
this.textBoxBeginTime.MaxLength = 20; this.textBoxBeginTime.MaxLength = 20;
this.textBoxBeginTime.Multiline = true; this.textBoxBeginTime.Multiline = true;
this.textBoxBeginTime.Name = "textBoxBeginTime"; this.textBoxBeginTime.Name = "textBoxBeginTime";
this.textBoxBeginTime.Size = new System.Drawing.Size(165, 30);
this.textBoxBeginTime.Size = new System.Drawing.Size(124, 30);
this.textBoxBeginTime.TabIndex = 14; this.textBoxBeginTime.TabIndex = 14;
this.textBoxBeginTime.TabStop = false; this.textBoxBeginTime.TabStop = false;
this.textBoxBeginTime.DoubleClick += new System.EventHandler(this.textBoxBeginTime_DoubleClick); this.textBoxBeginTime.DoubleClick += new System.EventHandler(this.textBoxBeginTime_DoubleClick);
@ -370,17 +375,17 @@ namespace B3ButcherWeightClient {
// //
this.label5.AutoSize = true; this.label5.AutoSize = true;
this.label5.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label5.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label5.Location = new System.Drawing.Point(278, 17);
this.label5.Location = new System.Drawing.Point(240, 62);
this.label5.Name = "label5"; this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(29, 20); this.label5.Size = new System.Drawing.Size(29, 20);
this.label5.TabIndex = 11; this.label5.TabIndex = 11;
this.label5.Text = "->";
this.label5.Text = "->";
// //
// label6 // label6
// //
this.label6.AutoSize = true; this.label6.AutoSize = true;
this.label6.Font = new System.Drawing.Font("宋体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label6.Font = new System.Drawing.Font("宋体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label6.Location = new System.Drawing.Point(6, 22);
this.label6.Location = new System.Drawing.Point(9, 64);
this.label6.Name = "label6"; this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(95, 19); this.label6.Size = new System.Drawing.Size(95, 19);
this.label6.TabIndex = 12; this.label6.TabIndex = 12;
@ -401,7 +406,7 @@ namespace B3ButcherWeightClient {
this.groupBox1.Controls.Add(this.label4); this.groupBox1.Controls.Add(this.label4);
this.groupBox1.Location = new System.Drawing.Point(3, 6); this.groupBox1.Location = new System.Drawing.Point(3, 6);
this.groupBox1.Name = "groupBox1"; this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(655, 93);
this.groupBox1.Size = new System.Drawing.Size(585, 93);
this.groupBox1.TabIndex = 0; this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false; this.groupBox1.TabStop = false;
this.groupBox1.Text = "称重"; this.groupBox1.Text = "称重";
@ -412,7 +417,7 @@ namespace B3ButcherWeightClient {
this.jdTextBox.Location = new System.Drawing.Point(81, 12); this.jdTextBox.Location = new System.Drawing.Point(81, 12);
this.jdTextBox.Multiline = true; this.jdTextBox.Multiline = true;
this.jdTextBox.Name = "jdTextBox"; this.jdTextBox.Name = "jdTextBox";
this.jdTextBox.Size = new System.Drawing.Size(173, 30);
this.jdTextBox.Size = new System.Drawing.Size(129, 30);
this.jdTextBox.TabIndex = 8; this.jdTextBox.TabIndex = 8;
// //
// batchComboBox // batchComboBox
@ -424,14 +429,14 @@ namespace B3ButcherWeightClient {
this.batchComboBox.IntegralHeight = false; this.batchComboBox.IntegralHeight = false;
this.batchComboBox.Location = new System.Drawing.Point(81, 55); this.batchComboBox.Location = new System.Drawing.Point(81, 55);
this.batchComboBox.Name = "batchComboBox"; this.batchComboBox.Name = "batchComboBox";
this.batchComboBox.Size = new System.Drawing.Size(173, 24);
this.batchComboBox.Size = new System.Drawing.Size(129, 24);
this.batchComboBox.TabIndex = 20; this.batchComboBox.TabIndex = 20;
this.batchComboBox.TextUpdate += new System.EventHandler(this.batchComboBox_TextUpdate); this.batchComboBox.TextUpdate += new System.EventHandler(this.batchComboBox_TextUpdate);
// //
// saveButton // saveButton
// //
this.saveButton.Font = new System.Drawing.Font("宋体", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.saveButton.Font = new System.Drawing.Font("宋体", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.saveButton.Location = new System.Drawing.Point(492, 46);
this.saveButton.Location = new System.Drawing.Point(425, 49);
this.saveButton.Name = "saveButton"; this.saveButton.Name = "saveButton";
this.saveButton.Size = new System.Drawing.Size(154, 37); this.saveButton.Size = new System.Drawing.Size(154, 37);
this.saveButton.TabIndex = 7; this.saveButton.TabIndex = 7;
@ -442,17 +447,17 @@ namespace B3ButcherWeightClient {
// tbxSequence // tbxSequence
// //
this.tbxSequence.Font = new System.Drawing.Font("宋体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.tbxSequence.Font = new System.Drawing.Font("宋体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.tbxSequence.Location = new System.Drawing.Point(492, 14);
this.tbxSequence.Location = new System.Drawing.Point(466, 12);
this.tbxSequence.Name = "tbxSequence"; this.tbxSequence.Name = "tbxSequence";
this.tbxSequence.ReadOnly = true; this.tbxSequence.ReadOnly = true;
this.tbxSequence.Size = new System.Drawing.Size(154, 29);
this.tbxSequence.Size = new System.Drawing.Size(110, 29);
this.tbxSequence.TabIndex = 11; this.tbxSequence.TabIndex = 11;
// //
// lblNumber // lblNumber
// //
this.lblNumber.AutoSize = true; this.lblNumber.AutoSize = true;
this.lblNumber.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lblNumber.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblNumber.Location = new System.Drawing.Point(419, 17);
this.lblNumber.Location = new System.Drawing.Point(381, 17);
this.lblNumber.Name = "lblNumber"; this.lblNumber.Name = "lblNumber";
this.lblNumber.Size = new System.Drawing.Size(79, 20); this.lblNumber.Size = new System.Drawing.Size(79, 20);
this.lblNumber.TabIndex = 12; this.lblNumber.TabIndex = 12;
@ -481,7 +486,7 @@ namespace B3ButcherWeightClient {
// numberTextBox // numberTextBox
// //
this.numberTextBox.Font = new System.Drawing.Font("宋体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.numberTextBox.Font = new System.Drawing.Font("宋体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.numberTextBox.Location = new System.Drawing.Point(326, 49);
this.numberTextBox.Location = new System.Drawing.Point(282, 49);
this.numberTextBox.Multiline = true; this.numberTextBox.Multiline = true;
this.numberTextBox.Name = "numberTextBox"; this.numberTextBox.Name = "numberTextBox";
this.numberTextBox.Size = new System.Drawing.Size(87, 30); this.numberTextBox.Size = new System.Drawing.Size(87, 30);
@ -491,7 +496,7 @@ namespace B3ButcherWeightClient {
// //
this.label2.AutoSize = true; this.label2.AutoSize = true;
this.label2.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label2.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label2.Location = new System.Drawing.Point(260, 22);
this.label2.Location = new System.Drawing.Point(216, 22);
this.label2.Name = "label2"; this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(59, 20); this.label2.Size = new System.Drawing.Size(59, 20);
this.label2.TabIndex = 12; this.label2.TabIndex = 12;
@ -500,21 +505,21 @@ namespace B3ButcherWeightClient {
// subWeightTextBox // subWeightTextBox
// //
this.subWeightTextBox.Font = new System.Drawing.Font("宋体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.subWeightTextBox.Font = new System.Drawing.Font("宋体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.subWeightTextBox.Location = new System.Drawing.Point(326, 12);
this.subWeightTextBox.Location = new System.Drawing.Point(282, 12);
this.subWeightTextBox.Multiline = true; this.subWeightTextBox.Multiline = true;
this.subWeightTextBox.Name = "subWeightTextBox"; this.subWeightTextBox.Name = "subWeightTextBox";
this.subWeightTextBox.Size = new System.Drawing.Size(87, 30); this.subWeightTextBox.Size = new System.Drawing.Size(87, 30);
this.subWeightTextBox.TabIndex = 8;
this.subWeightTextBox.TabIndex = 8;
// //
// label4 // label4
// //
this.label4.AutoSize = true; this.label4.AutoSize = true;
this.label4.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label4.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label4.Location = new System.Drawing.Point(261, 59);
this.label4.Location = new System.Drawing.Point(217, 59);
this.label4.Name = "label4"; this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(59, 20); this.label4.Size = new System.Drawing.Size(59, 20);
this.label4.TabIndex = 12; this.label4.TabIndex = 12;
this.label4.Text = "头数:";
this.label4.Text = "头数:";
// //
// pictureBox1 // pictureBox1
// //
@ -531,16 +536,25 @@ namespace B3ButcherWeightClient {
// //
this.panel1.AutoScroll = true; this.panel1.AutoScroll = true;
this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panel1.Controls.Add(this.monthCalendar);
this.panel1.Location = new System.Drawing.Point(3, 208); this.panel1.Location = new System.Drawing.Point(3, 208);
this.panel1.Name = "panel1"; this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(655, 537);
this.panel1.Size = new System.Drawing.Size(585, 557);
this.panel1.TabIndex = 6; this.panel1.TabIndex = 6;
// //
// monthCalendar
//
this.monthCalendar.Location = new System.Drawing.Point(138, -1);
this.monthCalendar.Name = "monthCalendar";
this.monthCalendar.TabIndex = 7;
this.monthCalendar.DateChanged += new System.Windows.Forms.DateRangeEventHandler(this.monthCalendar_DateSelected);
//
// Main // Main
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1387, 748);
this.ClientSize = new System.Drawing.Size(1184, 768);
this.ControlBox = false;
this.Controls.Add(this.splitContainer1); this.Controls.Add(this.splitContainer1);
this.Name = "Main"; this.Name = "Main";
this.Text = "青花瓷称重客户端"; this.Text = "青花瓷称重客户端";
@ -550,12 +564,13 @@ namespace B3ButcherWeightClient {
this.splitContainer1.Panel2.ResumeLayout(false); this.splitContainer1.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false); this.splitContainer1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
this.groupBox2.ResumeLayout(false); this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout(); this.groupBox2.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
this.groupBox1.ResumeLayout(false); this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout(); this.groupBox1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.panel1.ResumeLayout(false);
this.ResumeLayout(false); this.ResumeLayout(false);
} }
@ -600,5 +615,6 @@ namespace B3ButcherWeightClient {
private System.Windows.Forms.DataGridViewTextBoxColumn subColumn; private System.Windows.Forms.DataGridViewTextBoxColumn subColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn Weight; private System.Windows.Forms.DataGridViewTextBoxColumn Weight;
private System.Windows.Forms.DataGridViewButtonColumn DeleteDetail; private System.Windows.Forms.DataGridViewButtonColumn DeleteDetail;
private System.Windows.Forms.Button button3;
} }
} }

+ 21
- 7
B3ButcherWeightClient/Main.cs View File

@ -1,5 +1,4 @@
using System; using System;
using System.Collections;
using System.Collections.Concurrent; using System.Collections.Concurrent;
using System.Collections.Generic; using System.Collections.Generic;
using System.Data; using System.Data;
@ -17,7 +16,6 @@ using Forks.EnterpriseServices.DomainObjects2.DQuery;
using Forks.JsonRpc.Client.Data; using Forks.JsonRpc.Client.Data;
using Forks.Utils.Data; using Forks.Utils.Data;
using Timer = System.Threading.Timer; using Timer = System.Threading.Timer;
using System.Web.Script.Serialization;
namespace B3ButcherWeightClient { namespace B3ButcherWeightClient {
public partial class Main : Form { public partial class Main : Form {
@ -185,8 +183,10 @@ namespace B3ButcherWeightClient {
MessageBox.Show("头数录入的格式错误"); MessageBox.Show("头数录入的格式错误");
return; return;
} }
if (decimal.TryParse(_displayValue, out w))
if (decimal.TryParse(_displayValue, out w)) {
AddWeightInfo(w, number); AddWeightInfo(w, number);
QueryResult();
}
else { else {
MessageBox.Show("重量格式错误"); MessageBox.Show("重量格式错误");
} }
@ -260,8 +260,8 @@ namespace B3ButcherWeightClient {
foreach (var info in _dTable) { foreach (var info in _dTable) {
var bt = new Button(); var bt = new Button();
bt.Text = info.; bt.Text = info.;
bt.Size = new Size(200, 100);
bt.Left = i * 203;
bt.Size = new Size(190, 100);
bt.Left = i * 193;
bt.Top = j * 102; bt.Top = j * 102;
bt.Tag = info; bt.Tag = info;
bt.Click += bt_Click; bt.Click += bt_Click;
@ -342,7 +342,8 @@ namespace B3ButcherWeightClient {
// 解析接受的端口数据 // 解析接受的端口数据
if (_dataFormat.ParseAscii(subStr, out str, out isStatic)) { if (_dataFormat.ParseAscii(subStr, out str, out isStatic)) {
_displayValue = str; _displayValue = str;
WinApiSendMessage.SendMessage(_mainHandle, WmUpdDisplayMessage, 0, 0);
lblDisplay.Text = _displayValue;
//WinApiSendMessage.SendMessage(_mainHandle, WmUpdDisplayMessage, 0, 0);
} }
decimal num; decimal num;
if (ConfigUtil.ReadType == "0") { if (ConfigUtil.ReadType == "0") {
@ -663,7 +664,7 @@ namespace B3ButcherWeightClient {
detail1.Set("Goods_Name", first.Livestock_Name); detail1.Set("Goods_Name", first.Livestock_Name);
detail1.Set("GoodsBatch_ID", @group.Key.GoodsBatchID); detail1.Set("GoodsBatch_ID", @group.Key.GoodsBatchID);
detail1.Set("BodyWeight", weight - subWeight); detail1.Set("BodyWeight", weight - subWeight);
detail1.Set("SecondNumber", @group.Count() * 1.0m);
detail1.Set("SecondNumber", @group.Sum(x => x.Number ?? 0) * 1.0m);
detail1.Set("Number", weight - subWeight); detail1.Set("Number", weight - subWeight);
details2.Add(detail1); details2.Add(detail1);
} }
@ -672,6 +673,8 @@ namespace B3ButcherWeightClient {
bill.Set("Department_ID", ConfigUtil.DeptID); bill.Set("Department_ID", ConfigUtil.DeptID);
bill.Set("InputType_ID", ConfigUtil.TouruID); bill.Set("InputType_ID", ConfigUtil.TouruID);
bill.Set("ProductionUnit_ID", ConfigUtil.ShengchanID); bill.Set("ProductionUnit_ID", ConfigUtil.ShengchanID);
bill.Set("AccountingUnit_ID", ConfigUtil.AccID);
bill.Set("Domain_ID", ConfigUtil.BanKuaiID);
bill.Set("Remark", "称重客户端上传"); bill.Set("Remark", "称重客户端上传");
bill.Set("Details", details2); bill.Set("Details", details2);
bill.Set("WeightDetails", details); bill.Set("WeightDetails", details);
@ -712,6 +715,17 @@ namespace B3ButcherWeightClient {
MessageBox.Show("成功创建单据No." + id); MessageBox.Show("成功创建单据No." + id);
} }
private void button3_Click(object sender, EventArgs e)
{
string msg;
if(!RpcUtil.Logout(out msg))
{
MessageBox.Show(msg);
}
Environment.Exit(0);
}
} }
class IDName { class IDName {


+ 26
- 3
B3ButcherWeightClient/Parameters.Designer.cs View File

@ -34,6 +34,8 @@
this.txtBTouru = new System.Windows.Forms.TextBox(); this.txtBTouru = new System.Windows.Forms.TextBox();
this.txtShengchan = new System.Windows.Forms.TextBox(); this.txtShengchan = new System.Windows.Forms.TextBox();
this.btnSave = new System.Windows.Forms.Button(); this.btnSave = new System.Windows.Forms.Button();
this.label5 = new System.Windows.Forms.Label();
this.bankuaiTextBox = new System.Windows.Forms.TextBox();
this.SuspendLayout(); this.SuspendLayout();
// //
// label6 // label6
@ -43,7 +45,7 @@
this.label6.Name = "label6"; this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(65, 12); this.label6.Size = new System.Drawing.Size(65, 12);
this.label6.TabIndex = 28; this.label6.TabIndex = 28;
this.label6.Text = "生产单位ID";
this.label6.Text = "生产单位ID";
// //
// label1 // label1
// //
@ -52,7 +54,7 @@
this.label1.Name = "label1"; this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(65, 12); this.label1.Size = new System.Drawing.Size(65, 12);
this.label1.TabIndex = 20; this.label1.TabIndex = 20;
this.label1.Text = "会计单位ID";
this.label1.Text = "会计单位ID";
// //
// txtBAcc // txtBAcc
// //
@ -94,7 +96,7 @@
this.txtBoxStore.MaxLength = 20; this.txtBoxStore.MaxLength = 20;
this.txtBoxStore.Name = "txtBoxStore"; this.txtBoxStore.Name = "txtBoxStore";
this.txtBoxStore.Size = new System.Drawing.Size(100, 21); this.txtBoxStore.Size = new System.Drawing.Size(100, 21);
this.txtBoxStore.TabIndex = 27;
this.txtBoxStore.TabIndex = 27;
// //
// label3 // label3
// //
@ -131,6 +133,23 @@
this.btnSave.UseVisualStyleBackColor = true; this.btnSave.UseVisualStyleBackColor = true;
this.btnSave.Click += new System.EventHandler(this.btnSave_Click); this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
// //
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(204, 111);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(41, 12);
this.label5.TabIndex = 18;
this.label5.Text = "板块ID";
//
// bankuaiTextBox
//
this.bankuaiTextBox.Location = new System.Drawing.Point(275, 108);
this.bankuaiTextBox.MaxLength = 20;
this.bankuaiTextBox.Name = "bankuaiTextBox";
this.bankuaiTextBox.Size = new System.Drawing.Size(100, 21);
this.bankuaiTextBox.TabIndex = 27;
//
// Parameters // Parameters
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@ -143,6 +162,8 @@
this.Controls.Add(this.label4); this.Controls.Add(this.label4);
this.Controls.Add(this.txtBoxDept); this.Controls.Add(this.txtBoxDept);
this.Controls.Add(this.label2); this.Controls.Add(this.label2);
this.Controls.Add(this.bankuaiTextBox);
this.Controls.Add(this.label5);
this.Controls.Add(this.txtBoxStore); this.Controls.Add(this.txtBoxStore);
this.Controls.Add(this.label3); this.Controls.Add(this.label3);
this.Controls.Add(this.txtBTouru); this.Controls.Add(this.txtBTouru);
@ -167,5 +188,7 @@
private System.Windows.Forms.TextBox txtBTouru; private System.Windows.Forms.TextBox txtBTouru;
private System.Windows.Forms.TextBox txtShengchan; private System.Windows.Forms.TextBox txtShengchan;
private System.Windows.Forms.Button btnSave; private System.Windows.Forms.Button btnSave;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.TextBox bankuaiTextBox;
} }
} }

+ 9
- 2
B3ButcherWeightClient/Parameters.cs View File

@ -22,7 +22,7 @@ namespace B3ButcherWeightClient {
txtBoxStore.Text = nutFile.AsString(ConfigItem.StoreID, ""); txtBoxStore.Text = nutFile.AsString(ConfigItem.StoreID, "");
txtBTouru.Text = nutFile.AsString(ConfigItem.TouruID, ""); txtBTouru.Text = nutFile.AsString(ConfigItem.TouruID, "");
txtShengchan.Text = nutFile.AsString(ConfigItem.ShengchanID, ""); txtShengchan.Text = nutFile.AsString(ConfigItem.ShengchanID, "");
bankuaiTextBox.Text = nutFile.AsString(ConfigItem.BanKuaiID, "");
} }
} }
@ -34,7 +34,7 @@ namespace B3ButcherWeightClient {
nutFile.SetValue(ConfigItem.StoreID, txtBoxStore.Text.Trim()); nutFile.SetValue(ConfigItem.StoreID, txtBoxStore.Text.Trim());
nutFile.SetValue(ConfigItem.ShengchanID, txtShengchan.Text.Trim()); nutFile.SetValue(ConfigItem.ShengchanID, txtShengchan.Text.Trim());
nutFile.SetValue(ConfigItem.TouruID, txtBTouru.Text.Trim()); nutFile.SetValue(ConfigItem.TouruID, txtBTouru.Text.Trim());
nutFile.SetValue(ConfigItem.BanKuaiID, bankuaiTextBox.Text.Trim());
using (TextWriter writer = FS.OpenWriter(ConfigUtil.ParametersPath, createDirsIfNotExist: true)) { using (TextWriter writer = FS.OpenWriter(ConfigUtil.ParametersPath, createDirsIfNotExist: true)) {
nutFile.Write(writer); nutFile.Write(writer);
} }
@ -70,6 +70,13 @@ namespace B3ButcherWeightClient {
} else { } else {
long.TryParse(str, out ConfigUtil.ShengchanID); long.TryParse(str, out ConfigUtil.ShengchanID);
} }
str = bankuaiTextBox.Text;
if (string.IsNullOrEmpty(str)) {
ConfigUtil.BanKuaiID = 0;
} else {
long.TryParse(str, out ConfigUtil.BanKuaiID);
}
Dispose(); Dispose();
} }
} }


Loading…
Cancel
Save