3.25 测试

改端子扫码,产线页面,主页
This commit is contained in:
zhougf committed 2025-03-25 21:22:36 +08:00
1 parent bd70f38e1a
commit 083c4ec3ac
16 files changed
+1016 -877

No files matched your search

@@ -30,11 +30,11 @@ namespace WindowsFormsApp1.form
MessageBox.Show("关键字不能为空");
return;
}
if (string.IsNullOrWhiteSpace(值.Text))
{
MessageBox.Show("值不能为空");
return;
}
//if (string.IsNullOrWhiteSpace(值.Text))
//{
// MessageBox.Show("值不能为空");
// return;
//}
if (string.IsNullOrWhiteSpace(备注.Text))
{
MessageBox.Show("备注不能为空");
+73 -73
View File
@@ -41,9 +41,9 @@
this.label7 = new System.Windows.Forms.Label();
this.产线编号 = new System.Windows.Forms.TextBox();
this.关联流程 = new System.Windows.Forms.ComboBox();
this.备用显示1 = new System.Windows.Forms.TextBox();
this.备用显示2 = new System.Windows.Forms.TextBox();
this.备用显示3 = new System.Windows.Forms.TextBox();
this.Line = new System.Windows.Forms.TextBox();
this.StationID = new System.Windows.Forms.TextBox();
this.MachineID = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
@@ -73,9 +73,9 @@
this.tableLayoutPanel1.Controls.Add(this.label7, 1, 2);
this.tableLayoutPanel1.Controls.Add(this.产线编号, 2, 2);
this.tableLayoutPanel1.Controls.Add(this.关联流程, 2, 5);
this.tableLayoutPanel1.Controls.Add(this.备用显示1, 4, 1);
this.tableLayoutPanel1.Controls.Add(this.备用显示2, 4, 2);
this.tableLayoutPanel1.Controls.Add(this.备用显示3, 4, 3);
this.tableLayoutPanel1.Controls.Add(this.Line, 4, 1);
this.tableLayoutPanel1.Controls.Add(this.StationID, 4, 2);
this.tableLayoutPanel1.Controls.Add(this.MachineID, 4, 3);
this.tableLayoutPanel1.Controls.Add(this.label5, 3, 1);
this.tableLayoutPanel1.Controls.Add(this.label6, 3, 2);
this.tableLayoutPanel1.Controls.Add(this.label8, 3, 3);
@@ -96,7 +96,7 @@
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(1087, 854);
this.tableLayoutPanel1.Size = new System.Drawing.Size(1186, 976);
this.tableLayoutPanel1.TabIndex = 0;
//
// label1
@@ -104,9 +104,9 @@
this.label1.Anchor = System.Windows.Forms.AnchorStyles.None;
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label1.Location = new System.Drawing.Point(182, 113);
this.label1.Location = new System.Drawing.Point(197, 129);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(68, 28);
this.label1.Size = new System.Drawing.Size(79, 33);
this.label1.TabIndex = 0;
this.label1.Text = "名称";
//
@@ -115,9 +115,9 @@
this.button1.Anchor = System.Windows.Forms.AnchorStyles.None;
this.tableLayoutPanel1.SetColumnSpan(this.button1, 2);
this.button1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button1.Location = new System.Drawing.Point(228, 683);
this.button1.Location = new System.Drawing.Point(249, 779);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(194, 79);
this.button1.Size = new System.Drawing.Size(212, 90);
this.button1.TabIndex = 14;
this.button1.Text = "保存";
this.button1.UseVisualStyleBackColor = true;
@@ -128,9 +128,9 @@
this.button2.Anchor = System.Windows.Forms.AnchorStyles.None;
this.tableLayoutPanel1.SetColumnSpan(this.button2, 2);
this.button2.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button2.Location = new System.Drawing.Point(664, 683);
this.button2.Location = new System.Drawing.Point(725, 779);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(190, 79);
this.button2.Size = new System.Drawing.Size(207, 90);
this.button2.TabIndex = 15;
this.button2.Text = "取消";
this.button2.UseVisualStyleBackColor = true;
@@ -140,9 +140,9 @@
//
this.名称.Anchor = System.Windows.Forms.AnchorStyles.None;
this.名称.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.名称.Location = new System.Drawing.Point(328, 108);
this.名称.Location = new System.Drawing.Point(358, 123);
this.名称.Name = "名称";
this.名称.Size = new System.Drawing.Size(211, 39);
this.名称.Size = new System.Drawing.Size(230, 44);
this.名称.TabIndex = 16;
//
// label4
@@ -150,9 +150,9 @@
this.label4.Anchor = System.Windows.Forms.AnchorStyles.None;
this.label4.AutoSize = true;
this.label4.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label4.Location = new System.Drawing.Point(154, 453);
this.label4.Location = new System.Drawing.Point(165, 517);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(124, 28);
this.label4.Size = new System.Drawing.Size(143, 33);
this.label4.TabIndex = 3;
this.label4.Text = "关联流程";
//
@@ -161,39 +161,39 @@
this.label3.Anchor = System.Windows.Forms.AnchorStyles.None;
this.label3.AutoSize = true;
this.label3.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label3.Location = new System.Drawing.Point(182, 368);
this.label3.Location = new System.Drawing.Point(197, 420);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(68, 28);
this.label3.Size = new System.Drawing.Size(79, 33);
this.label3.TabIndex = 2;
this.label3.Text = "模组";
this.label3.Text = "Mold";
//
// label2
//
this.label2.Anchor = System.Windows.Forms.AnchorStyles.None;
this.label2.AutoSize = true;
this.label2.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label2.Location = new System.Drawing.Point(154, 283);
this.label2.Location = new System.Drawing.Point(189, 323);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(124, 28);
this.label2.Size = new System.Drawing.Size(95, 33);
this.label2.TabIndex = 1;
this.label2.Text = "产线类型";
this.label2.Text = "FixSn";
//
// 模组
//
this.模组.Anchor = System.Windows.Forms.AnchorStyles.None;
this.模组.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.模组.Location = new System.Drawing.Point(328, 363);
this.模组.Location = new System.Drawing.Point(358, 414);
this.模组.Name = "模组";
this.模组.Size = new System.Drawing.Size(211, 39);
this.模组.Size = new System.Drawing.Size(230, 44);
this.模组.TabIndex = 20;
//
// 产线类型
//
this.产线类型.Anchor = System.Windows.Forms.AnchorStyles.None;
this.产线类型.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.产线类型.Location = new System.Drawing.Point(328, 278);
this.产线类型.Location = new System.Drawing.Point(358, 317);
this.产线类型.Name = "产线类型";
this.产线类型.Size = new System.Drawing.Size(211, 39);
this.产线类型.Size = new System.Drawing.Size(230, 44);
this.产线类型.TabIndex = 17;
//
// label7
@@ -201,19 +201,19 @@
this.label7.Anchor = System.Windows.Forms.AnchorStyles.None;
this.label7.AutoSize = true;
this.label7.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label7.Location = new System.Drawing.Point(154, 198);
this.label7.Location = new System.Drawing.Point(189, 226);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(124, 28);
this.label7.Size = new System.Drawing.Size(95, 33);
this.label7.TabIndex = 29;
this.label7.Text = "产线编号";
this.label7.Text = "Token";
//
// 产线编号
//
this.产线编号.Anchor = System.Windows.Forms.AnchorStyles.None;
this.产线编号.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.产线编号.Location = new System.Drawing.Point(328, 193);
this.产线编号.Location = new System.Drawing.Point(358, 220);
this.产线编号.Name = "产线编号";
this.产线编号.Size = new System.Drawing.Size(211, 39);
this.产线编号.Size = new System.Drawing.Size(230, 44);
this.产线编号.TabIndex = 30;
//
// 关联流程
@@ -222,79 +222,79 @@
this.tableLayoutPanel1.SetColumnSpan(this.关联流程, 3);
this.关联流程.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.关联流程.FormattingEnabled = true;
this.关联流程.Location = new System.Drawing.Point(364, 453);
this.关联流程.Location = new System.Drawing.Point(398, 517);
this.关联流程.Name = "关联流程";
this.关联流程.Size = new System.Drawing.Size(573, 36);
this.关联流程.Size = new System.Drawing.Size(625, 41);
this.关联流程.TabIndex = 31;
//
// 备用显示1
// Line
//
this.备用显示1.Anchor = System.Windows.Forms.AnchorStyles.None;
this.备用显示1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.备用显示1.Location = new System.Drawing.Point(762, 108);
this.备用显示1.Name = "备用显示1";
this.备用显示1.Size = new System.Drawing.Size(211, 39);
this.备用显示1.TabIndex = 32;
this.Line.Anchor = System.Windows.Forms.AnchorStyles.None;
this.Line.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Line.Location = new System.Drawing.Point(832, 123);
this.Line.Name = "Line";
this.Line.Size = new System.Drawing.Size(230, 44);
this.Line.TabIndex = 32;
//
// 备用显示2
// StationID
//
this.备用显示2.Anchor = System.Windows.Forms.AnchorStyles.None;
this.备用显示2.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.备用显示2.Location = new System.Drawing.Point(762, 193);
this.备用显示2.Name = "备用显示2";
this.备用显示2.Size = new System.Drawing.Size(211, 39);
this.备用显示2.TabIndex = 33;
this.StationID.Anchor = System.Windows.Forms.AnchorStyles.None;
this.StationID.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.StationID.Location = new System.Drawing.Point(832, 220);
this.StationID.Name = "StationID";
this.StationID.Size = new System.Drawing.Size(230, 44);
this.StationID.TabIndex = 33;
//
// 备用显示3
// MachineID
//
this.备用显示3.Anchor = System.Windows.Forms.AnchorStyles.None;
this.备用显示3.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.备用显示3.Location = new System.Drawing.Point(762, 278);
this.备用显示3.Name = "备用显示3";
this.备用显示3.Size = new System.Drawing.Size(211, 39);
this.备用显示3.TabIndex = 34;
this.MachineID.Anchor = System.Windows.Forms.AnchorStyles.None;
this.MachineID.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.MachineID.Location = new System.Drawing.Point(832, 317);
this.MachineID.Name = "MachineID";
this.MachineID.Size = new System.Drawing.Size(230, 44);
this.MachineID.TabIndex = 34;
//
// label5
//
this.label5.Anchor = System.Windows.Forms.AnchorStyles.None;
this.label5.AutoSize = true;
this.label5.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label5.Location = new System.Drawing.Point(581, 113);
this.label5.Location = new System.Drawing.Point(671, 129);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(138, 28);
this.label5.Size = new System.Drawing.Size(79, 33);
this.label5.TabIndex = 35;
this.label5.Text = "备用显示1";
this.label5.Text = "Line";
//
// label6
//
this.label6.Anchor = System.Windows.Forms.AnchorStyles.None;
this.label6.AutoSize = true;
this.label6.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label6.Location = new System.Drawing.Point(581, 198);
this.label6.Location = new System.Drawing.Point(631, 226);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(138, 28);
this.label6.Size = new System.Drawing.Size(159, 33);
this.label6.TabIndex = 36;
this.label6.Text = "备用显示2";
this.label6.Text = "StationID";
//
// label8
//
this.label8.Anchor = System.Windows.Forms.AnchorStyles.None;
this.label8.AutoSize = true;
this.label8.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label8.Location = new System.Drawing.Point(581, 283);
this.label8.Location = new System.Drawing.Point(631, 323);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(138, 28);
this.label8.Size = new System.Drawing.Size(159, 33);
this.label8.TabIndex = 37;
this.label8.Text = "备用显示3";
this.label8.Text = "MachineID";
//
// label9
//
this.label9.Anchor = System.Windows.Forms.AnchorStyles.None;
this.label9.AutoSize = true;
this.label9.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label9.Location = new System.Drawing.Point(161, 538);
this.label9.Location = new System.Drawing.Point(173, 614);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(110, 28);
this.label9.Size = new System.Drawing.Size(127, 33);
this.label9.TabIndex = 38;
this.label9.Text = "关联PLC";
//
@@ -304,16 +304,16 @@
this.tableLayoutPanel1.SetColumnSpan(this.关联PLC, 3);
this.关联PLC.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.关联PLC.FormattingEnabled = true;
this.关联PLC.Location = new System.Drawing.Point(364, 538);
this.关联PLC.Location = new System.Drawing.Point(398, 614);
this.关联PLC.Name = "关联PLC";
this.关联PLC.Size = new System.Drawing.Size(573, 36);
this.关联PLC.Size = new System.Drawing.Size(625, 41);
this.关联PLC.TabIndex = 39;
//
// Line_Insert
//
this.AutoScaleDimensions = new System.Drawing.SizeF(11F, 21F);
this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1087, 854);
this.ClientSize = new System.Drawing.Size(1186, 976);
this.Controls.Add(this.tableLayoutPanel1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Name = "Line_Insert";
@@ -340,9 +340,9 @@
private System.Windows.Forms.Label label7;
private System.Windows.Forms.TextBox 产线编号;
private System.Windows.Forms.ComboBox 关联流程;
private System.Windows.Forms.TextBox 备用显示1;
private System.Windows.Forms.TextBox 备用显示2;
private System.Windows.Forms.TextBox 备用显示3;
private System.Windows.Forms.TextBox Line;
private System.Windows.Forms.TextBox StationID;
private System.Windows.Forms.TextBox MachineID;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label8;
+46 -43
View File
@@ -31,36 +31,36 @@ namespace WindowsFormsApp1.form
MessageBox.Show("名称不能为空");
return;
}
if (string.IsNullOrWhiteSpace(产线类型.Text))
{
MessageBox.Show("产线类型不能为空");
return;
}
if (string.IsNullOrWhiteSpace(产线编号.Text))
{
MessageBox.Show("产线编号不能为空");
return;
}
if (string.IsNullOrWhiteSpace(模组.Text))
{
MessageBox.Show("模组不能为空");
return;
}
if (string.IsNullOrWhiteSpace(备用显示1.Text))
{
MessageBox.Show("备用显示1不能为空");
return;
}
if (string.IsNullOrWhiteSpace(备用显示2.Text))
{
MessageBox.Show("备用显示2不能为空");
return;
}
if (string.IsNullOrWhiteSpace(备用显示3.Text))
{
MessageBox.Show("备用显示3不能为空");
return;
}
//if (string.IsNullOrWhiteSpace(产线类型.Text))
//{
// MessageBox.Show("产线类型不能为空");
// return;
//}
//if (string.IsNullOrWhiteSpace(产线编号.Text))
//{
// MessageBox.Show("产线编号不能为空");
// return;
//}
//if (string.IsNullOrWhiteSpace(模组.Text))
//{
// MessageBox.Show("模组不能为空");
// return;
//}
//if (string.IsNullOrWhiteSpace(Line.Text))
//{
// MessageBox.Show("Line不能为空");
// return;
//}
//if (string.IsNullOrWhiteSpace(StationID.Text))
//{
// MessageBox.Show("StationID不能为空");
// return;
//}
//if (string.IsNullOrWhiteSpace(MachineID.Text))
//{
// MessageBox.Show("MachineID不能为空");
// return;
//}
if (关联流程.SelectedValue == null || (int)关联流程.SelectedValue == 0)
{
MessageBox.Show("关联流程不能为空");
@@ -74,14 +74,17 @@ namespace WindowsFormsApp1.form
t_line t_Flow = new t_line();
t_Flow.linename = 名称.Text;
t_Flow.linetype = 产线类型.Text;
t_Flow.linecode = 产线编号.Text;
t_Flow.linemode = 模组.Text;
//t_Flow.linetype = 产线类型.Text;
//t_Flow.linecode = 产线编号.Text;
//t_Flow.linemode = 模组.Text;
t_Flow.flowid = (int)关联流程.SelectedValue;
t_Flow.plcid = (int)关联PLC.SelectedValue;
t_Flow.lineremark1 = 备用显示1.Text;
t_Flow.lineremark2 = 备用显示2.Text;
t_Flow.lineremark3 = 备用显示3.Text;
t_Flow.lineremark1 = Line.Text;
t_Flow.lineremark2 = StationID.Text;
t_Flow.lineremark3 = MachineID.Text;
t_Flow.lineremark4 = 产线编号.Text;
t_Flow.lineremark5 = 产线类型.Text;
t_Flow.lineremark6 = 模组.Text;
SQLiteHelper<t_line> sQLiteHelper1 = new db.SQLiteHelper<t_line>();
@@ -92,7 +95,7 @@ namespace WindowsFormsApp1.form
}
else
{
sQLiteHelper1.Insert(t_Flow);
var re = sQLiteHelper1.Insert(t_Flow);
}
MessageBox.Show("保存成功");
this.Close();
@@ -158,12 +161,12 @@ namespace WindowsFormsApp1.form
}
var DataToEdit = result.Data;
名称.Text = DataToEdit.linename;
产线编号.Text = DataToEdit.linecode;
产线类型.Text = DataToEdit.linetype;
模组.Text = DataToEdit.linemode;
备用显示1.Text = DataToEdit.lineremark1;
备用显示2.Text = DataToEdit.lineremark2;
备用显示3.Text = DataToEdit.lineremark3;
产线编号.Text = DataToEdit.lineremark4;
产线类型.Text = DataToEdit.lineremark5;
模组.Text = DataToEdit.lineremark6;
Line.Text = DataToEdit.lineremark1;
StationID.Text = DataToEdit.lineremark2;
MachineID.Text = DataToEdit.lineremark3;
SelectItemByValue(关联流程, DataToEdit.flowid.ToString());
SelectItemByValue2(关联PLC, DataToEdit.plcid.ToString());
}