更改大部分页面,更改各个扫码逻辑
This commit is contained in:
1 parent
2bd24f5316
commit
1670395816
34 files changed
+2420
-1425
No files matched your search
+44
-75
@@ -34,10 +34,6 @@
|
||||
this.关闭 = new System.Windows.Forms.Button();
|
||||
this.查询 = new System.Windows.Forms.Button();
|
||||
this.dataGridView1 = new System.Windows.Forms.DataGridView();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.comboBox1 = new System.Windows.Forms.ComboBox();
|
||||
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.id = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.plcname = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.code = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
@@ -47,6 +43,8 @@
|
||||
this.addresstype = new System.Windows.Forms.DataGridViewComboBoxColumn();
|
||||
this.addresstypelegth = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.remark = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
|
||||
this.tableLayoutPanel1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
@@ -83,8 +81,8 @@
|
||||
this.dataGridView1.AllowUserToDeleteRows = false;
|
||||
dataGridViewCellStyle1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.dataGridView1.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
|
||||
this.dataGridView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
this.dataGridView1.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)));
|
||||
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
|
||||
dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control;
|
||||
@@ -114,77 +112,16 @@
|
||||
dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
|
||||
dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
|
||||
this.dataGridView1.DefaultCellStyle = dataGridViewCellStyle3;
|
||||
this.dataGridView1.Location = new System.Drawing.Point(6, 127);
|
||||
this.dataGridView1.Location = new System.Drawing.Point(6, 5);
|
||||
this.dataGridView1.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
|
||||
this.dataGridView1.Name = "dataGridView1";
|
||||
this.dataGridView1.ReadOnly = true;
|
||||
this.dataGridView1.RowHeadersWidth = 72;
|
||||
this.tableLayoutPanel1.SetRowSpan(this.dataGridView1, 3);
|
||||
this.tableLayoutPanel1.SetRowSpan(this.dataGridView1, 4);
|
||||
this.dataGridView1.RowTemplate.Height = 23;
|
||||
this.dataGridView1.Size = new System.Drawing.Size(1624, 682);
|
||||
this.dataGridView1.Size = new System.Drawing.Size(1624, 804);
|
||||
this.dataGridView1.TabIndex = 8;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.Anchor = System.Windows.Forms.AnchorStyles.Left;
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Font = new System.Drawing.Font("宋体", 14.14286F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.label1.Location = new System.Drawing.Point(4, 27);
|
||||
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(253, 68);
|
||||
this.label1.TabIndex = 12;
|
||||
this.label1.Text = "选择需要编辑的PLC编号:";
|
||||
//
|
||||
// comboBox1
|
||||
//
|
||||
this.comboBox1.Anchor = System.Windows.Forms.AnchorStyles.Left;
|
||||
this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.comboBox1.Font = new System.Drawing.Font("宋体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.comboBox1.FormattingEnabled = true;
|
||||
this.comboBox1.Location = new System.Drawing.Point(278, 40);
|
||||
this.comboBox1.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.comboBox1.Name = "comboBox1";
|
||||
this.comboBox1.Size = new System.Drawing.Size(409, 41);
|
||||
this.comboBox1.TabIndex = 13;
|
||||
//
|
||||
// tableLayoutPanel1
|
||||
//
|
||||
this.tableLayoutPanel1.ColumnCount = 3;
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 15.07911F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 74.9177F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10.00319F));
|
||||
this.tableLayoutPanel1.Controls.Add(this.button1, 2, 2);
|
||||
this.tableLayoutPanel1.Controls.Add(this.comboBox1, 1, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.dataGridView1, 0, 1);
|
||||
this.tableLayoutPanel1.Controls.Add(this.关闭, 2, 3);
|
||||
this.tableLayoutPanel1.Controls.Add(this.label1, 0, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.查询, 2, 0);
|
||||
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
|
||||
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
|
||||
this.tableLayoutPanel1.RowCount = 4;
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 15F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 45F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F));
|
||||
this.tableLayoutPanel1.Size = new System.Drawing.Size(1818, 814);
|
||||
this.tableLayoutPanel1.TabIndex = 14;
|
||||
//
|
||||
// button1
|
||||
//
|
||||
this.button1.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
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(1650, 541);
|
||||
this.button1.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(153, 56);
|
||||
this.button1.TabIndex = 15;
|
||||
this.button1.Text = "新增";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
this.button1.Click += new System.EventHandler(this.button1_Click);
|
||||
//
|
||||
// id
|
||||
//
|
||||
this.id.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
|
||||
@@ -270,7 +207,42 @@
|
||||
this.remark.Name = "remark";
|
||||
this.remark.ReadOnly = true;
|
||||
//
|
||||
// PlcAddress_Manage
|
||||
// tableLayoutPanel1
|
||||
//
|
||||
this.tableLayoutPanel1.ColumnCount = 3;
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 15.07911F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 74.9177F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10.00319F));
|
||||
this.tableLayoutPanel1.Controls.Add(this.button1, 2, 2);
|
||||
this.tableLayoutPanel1.Controls.Add(this.关闭, 2, 3);
|
||||
this.tableLayoutPanel1.Controls.Add(this.查询, 2, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.dataGridView1, 0, 0);
|
||||
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
|
||||
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
|
||||
this.tableLayoutPanel1.RowCount = 4;
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 15F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 45F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F));
|
||||
this.tableLayoutPanel1.Size = new System.Drawing.Size(1818, 814);
|
||||
this.tableLayoutPanel1.TabIndex = 14;
|
||||
//
|
||||
// button1
|
||||
//
|
||||
this.button1.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
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(1650, 541);
|
||||
this.button1.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(153, 56);
|
||||
this.button1.TabIndex = 15;
|
||||
this.button1.Text = "新增";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
this.button1.Click += new System.EventHandler(this.button1_Click);
|
||||
//
|
||||
// Angleaddress_Manage
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(11F, 21F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
@@ -278,14 +250,13 @@
|
||||
this.Controls.Add(this.tableLayoutPanel1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
|
||||
this.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.Name = "PlcAddress_Manage";
|
||||
this.Name = "Angleaddress_Manage";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "PLCADDRESS_Manage";
|
||||
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
|
||||
this.Load += new System.EventHandler(this.PLCADDRESS_Manage_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
|
||||
this.tableLayoutPanel1.ResumeLayout(false);
|
||||
this.tableLayoutPanel1.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
@@ -295,8 +266,6 @@
|
||||
private System.Windows.Forms.Button 关闭;
|
||||
private System.Windows.Forms.Button 查询;
|
||||
private System.Windows.Forms.DataGridView dataGridView1;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.ComboBox comboBox1;
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
|
||||
private System.Windows.Forms.Button button1;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn id;
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace WindowsFormsApp1.form
|
||||
|
||||
private void 查询_Click(object sender, EventArgs e)
|
||||
{
|
||||
GetInfo((int)comboBox1.SelectedValue);
|
||||
GetInfo();
|
||||
}
|
||||
|
||||
private void 保存_Click(object sender, EventArgs e)
|
||||
@@ -33,7 +33,7 @@ namespace WindowsFormsApp1.form
|
||||
if (result.Success)
|
||||
{
|
||||
MessageBox.Show("更新成功");
|
||||
GetInfo((int)comboBox1.SelectedValue);
|
||||
GetInfo();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -62,13 +62,6 @@ namespace WindowsFormsApp1.form
|
||||
return;
|
||||
}
|
||||
|
||||
var list = result_combox.Data.FindAll(a => Init.t_Lineplcs.Select(p => p.plcid).Contains(a.id));
|
||||
|
||||
// 绑定数据源到 ComboBox
|
||||
comboBox1.DataSource = list;
|
||||
comboBox1.DisplayMember = "plcname";
|
||||
comboBox1.ValueMember = "id";
|
||||
|
||||
var result1 = new List<object>
|
||||
{
|
||||
new {name = "read",value = "read"},
|
||||
@@ -134,7 +127,7 @@ namespace WindowsFormsApp1.form
|
||||
fLOW_Insert.dataid = selectid;
|
||||
fLOW_Insert.Operation = OperationType.Edit;
|
||||
fLOW_Insert.ShowDialog();
|
||||
GetInfo((int)comboBox1.SelectedValue);
|
||||
GetInfo();
|
||||
|
||||
}
|
||||
else if (e.ColumnIndex == 10)
|
||||
@@ -153,12 +146,12 @@ namespace WindowsFormsApp1.form
|
||||
{
|
||||
MessageBox.Show("删除失败");
|
||||
}
|
||||
GetInfo((int)comboBox1.SelectedValue);
|
||||
GetInfo();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public void GetInfo(int plcid)
|
||||
public void GetInfo()
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -166,7 +159,7 @@ namespace WindowsFormsApp1.form
|
||||
SQLiteHelper<t_angleaddress> sQLiteHelper = new db.SQLiteHelper<t_angleaddress>();
|
||||
SQLiteHelper<t_plc> sQLiteHelper1 = new db.SQLiteHelper<t_plc>();
|
||||
var result_plc = sQLiteHelper1.QueryAll();
|
||||
var result = sQLiteHelper.Query(a=>a.plcid == plcid);
|
||||
var result = sQLiteHelper.Query(a=>a.plcid == Init.t_Line.plcid);
|
||||
if (result.Success)
|
||||
{
|
||||
List<object> list = new List<object>();
|
||||
@@ -203,7 +196,7 @@ namespace WindowsFormsApp1.form
|
||||
{
|
||||
Angleaddress_Insert fLOW_Insert = new Angleaddress_Insert();
|
||||
fLOW_Insert.ShowDialog();
|
||||
GetInfo((int)comboBox1.SelectedValue);
|
||||
GetInfo();
|
||||
}
|
||||
}
|
||||
}
|
||||
+93
-37
@@ -34,14 +34,18 @@
|
||||
this.关闭 = new System.Windows.Forms.Button();
|
||||
this.查询 = new System.Windows.Forms.Button();
|
||||
this.dataGridView1 = new System.Windows.Forms.DataGridView();
|
||||
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.新增 = new System.Windows.Forms.Button();
|
||||
this.id = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.linename = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.linecode = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.linetype = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.linemode = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.lineremark1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.lineremark2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.lineremark3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.flowname = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.新增 = new System.Windows.Forms.Button();
|
||||
this.plcname = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
|
||||
this.tableLayoutPanel1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
@@ -96,7 +100,11 @@
|
||||
this.linecode,
|
||||
this.linetype,
|
||||
this.linemode,
|
||||
this.flowname});
|
||||
this.lineremark1,
|
||||
this.lineremark2,
|
||||
this.lineremark3,
|
||||
this.flowname,
|
||||
this.plcname});
|
||||
dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
|
||||
dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Window;
|
||||
dataGridViewCellStyle3.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
@@ -115,6 +123,40 @@
|
||||
this.dataGridView1.Size = new System.Drawing.Size(1584, 819);
|
||||
this.dataGridView1.TabIndex = 7;
|
||||
//
|
||||
// tableLayoutPanel1
|
||||
//
|
||||
this.tableLayoutPanel1.ColumnCount = 2;
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 90F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10F));
|
||||
this.tableLayoutPanel1.Controls.Add(this.关闭, 1, 3);
|
||||
this.tableLayoutPanel1.Controls.Add(this.dataGridView1, 0, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.查询, 1, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.新增, 1, 2);
|
||||
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
|
||||
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
|
||||
this.tableLayoutPanel1.RowCount = 4;
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 40F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F));
|
||||
this.tableLayoutPanel1.Size = new System.Drawing.Size(1774, 829);
|
||||
this.tableLayoutPanel1.TabIndex = 11;
|
||||
//
|
||||
// 新增
|
||||
//
|
||||
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(1604, 542);
|
||||
this.新增.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
|
||||
this.新增.Name = "新增";
|
||||
this.新增.Size = new System.Drawing.Size(162, 72);
|
||||
this.新增.TabIndex = 11;
|
||||
this.新增.Text = "新增";
|
||||
this.新增.UseVisualStyleBackColor = true;
|
||||
this.新增.Click += new System.EventHandler(this.新增_Click);
|
||||
//
|
||||
// id
|
||||
//
|
||||
this.id.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
|
||||
@@ -160,6 +202,39 @@
|
||||
this.linemode.Name = "linemode";
|
||||
this.linemode.ReadOnly = true;
|
||||
//
|
||||
// lineremark1
|
||||
//
|
||||
this.lineremark1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
|
||||
this.lineremark1.DataPropertyName = "lineremark1";
|
||||
this.lineremark1.HeaderText = "备用显示1";
|
||||
this.lineremark1.MinimumWidth = 9;
|
||||
this.lineremark1.Name = "lineremark1";
|
||||
this.lineremark1.ReadOnly = true;
|
||||
this.lineremark1.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
|
||||
this.lineremark1.ToolTipText = "lineremark1";
|
||||
//
|
||||
// lineremark2
|
||||
//
|
||||
this.lineremark2.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
|
||||
this.lineremark2.DataPropertyName = "lineremark2";
|
||||
this.lineremark2.HeaderText = "备用显示2";
|
||||
this.lineremark2.MinimumWidth = 9;
|
||||
this.lineremark2.Name = "lineremark2";
|
||||
this.lineremark2.ReadOnly = true;
|
||||
this.lineremark2.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
|
||||
this.lineremark2.ToolTipText = "lineremark2";
|
||||
//
|
||||
// lineremark3
|
||||
//
|
||||
this.lineremark3.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
|
||||
this.lineremark3.DataPropertyName = "lineremark3";
|
||||
this.lineremark3.HeaderText = "备用显示3";
|
||||
this.lineremark3.MinimumWidth = 9;
|
||||
this.lineremark3.Name = "lineremark3";
|
||||
this.lineremark3.ReadOnly = true;
|
||||
this.lineremark3.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
|
||||
this.lineremark3.ToolTipText = "lineremark3";
|
||||
//
|
||||
// flowname
|
||||
//
|
||||
this.flowname.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
|
||||
@@ -172,41 +247,18 @@
|
||||
this.flowname.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
|
||||
this.flowname.ToolTipText = "flowname";
|
||||
//
|
||||
// tableLayoutPanel1
|
||||
// plcname
|
||||
//
|
||||
this.tableLayoutPanel1.ColumnCount = 2;
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 90F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10F));
|
||||
this.tableLayoutPanel1.Controls.Add(this.关闭, 1, 3);
|
||||
this.tableLayoutPanel1.Controls.Add(this.dataGridView1, 0, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.查询, 1, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.新增, 1, 2);
|
||||
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
|
||||
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
|
||||
this.tableLayoutPanel1.RowCount = 4;
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 40F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F));
|
||||
this.tableLayoutPanel1.Size = new System.Drawing.Size(1774, 829);
|
||||
this.tableLayoutPanel1.TabIndex = 11;
|
||||
this.plcname.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
|
||||
this.plcname.DataPropertyName = "plcname";
|
||||
this.plcname.HeaderText = "关联PLC";
|
||||
this.plcname.MinimumWidth = 9;
|
||||
this.plcname.Name = "plcname";
|
||||
this.plcname.ReadOnly = true;
|
||||
this.plcname.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
|
||||
this.plcname.ToolTipText = "plcname";
|
||||
//
|
||||
// 新增
|
||||
//
|
||||
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(1604, 542);
|
||||
this.新增.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
|
||||
this.新增.Name = "新增";
|
||||
this.新增.Size = new System.Drawing.Size(162, 72);
|
||||
this.新增.TabIndex = 11;
|
||||
this.新增.Text = "新增";
|
||||
this.新增.UseVisualStyleBackColor = true;
|
||||
this.新增.Click += new System.EventHandler(this.新增_Click);
|
||||
//
|
||||
// LINE_Manage
|
||||
// Line_Manage
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(11F, 21F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
@@ -214,7 +266,7 @@
|
||||
this.Controls.Add(this.tableLayoutPanel1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
|
||||
this.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.Name = "LINE_Manage";
|
||||
this.Name = "Line_Manage";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "LINE_Mange";
|
||||
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
|
||||
@@ -237,6 +289,10 @@
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn linecode;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn linetype;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn linemode;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn lineremark1;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn lineremark2;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn lineremark3;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn flowname;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn plcname;
|
||||
}
|
||||
}
|
||||
@@ -55,7 +55,7 @@ namespace WindowsFormsApp1.form
|
||||
DataGridViewRow row = dataGridView.Rows[e.RowIndex];
|
||||
|
||||
int selectid = int.Parse(row.Cells[0].Value.ToString());
|
||||
if (e.ColumnIndex == 6)
|
||||
if (e.ColumnIndex == 10)
|
||||
{
|
||||
Line_Insert fLOW_Insert = new Line_Insert();
|
||||
fLOW_Insert.dataid = selectid;
|
||||
@@ -72,9 +72,11 @@ namespace WindowsFormsApp1.form
|
||||
{
|
||||
SQLiteHelper<t_line> sQLiteHelper = new db.SQLiteHelper<t_line>();
|
||||
SQLiteHelper<t_flow> sQLiteHelper1 = new db.SQLiteHelper<t_flow>();
|
||||
var result_flow = sQLiteHelper1.QueryAll();
|
||||
SQLiteHelper<t_plc> sQLiteHelper2 = new db.SQLiteHelper<t_plc>();
|
||||
var result_flow = sQLiteHelper1.Query(a=>a.flowid == Init.t_Line.flowid);
|
||||
var result_line = sQLiteHelper.Query(a=>a.id == Init.t_Line.id);
|
||||
if (!result_line.Success || !result_flow.Success)
|
||||
var result_plc = sQLiteHelper2.Query(a=>a.id == Init.t_Line.plcid);
|
||||
if (!result_line.Success || !result_flow.Success || !result_plc.Success)
|
||||
{
|
||||
MessageBox.Show("查询失败!");
|
||||
return;
|
||||
@@ -85,6 +87,7 @@ namespace WindowsFormsApp1.form
|
||||
foreach (var line in result_line.Data)
|
||||
{
|
||||
var flowname = result_flow.Data.FirstOrDefault(a=>a.flowid == line.flowid);
|
||||
var plcname = result_plc.Data.FirstOrDefault(a=>a.id == line.plcid);
|
||||
list.Add( new
|
||||
{
|
||||
id = line.id,
|
||||
@@ -94,6 +97,10 @@ namespace WindowsFormsApp1.form
|
||||
linetype = line.linetype,
|
||||
linemode = line.linemode,
|
||||
flowname = flowname.flowname,
|
||||
plcname = plcname.plcname,
|
||||
lineremark1 = line.lineremark1,
|
||||
lineremark2 = line.lineremark2,
|
||||
lineremark3 = line.lineremark3,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -132,7 +132,19 @@
|
||||
<metadata name="linemode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="lineremark1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="lineremark2.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="lineremark3.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="flowname.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="plcname.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
</root>
|
||||
-206
@@ -1,206 +0,0 @@
|
||||
namespace WindowsFormsApp1.form
|
||||
{
|
||||
partial class LinePLC_Manage
|
||||
{
|
||||
/// <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 dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
this.关闭 = new System.Windows.Forms.Button();
|
||||
this.查询 = new System.Windows.Forms.Button();
|
||||
this.dataGridView1 = new System.Windows.Forms.DataGridView();
|
||||
this.id = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.linename = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.flowname = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.新增 = new System.Windows.Forms.Button();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
|
||||
this.tableLayoutPanel1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// 关闭
|
||||
//
|
||||
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(1604, 709);
|
||||
this.关闭.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
|
||||
this.关闭.Name = "关闭";
|
||||
this.关闭.Size = new System.Drawing.Size(162, 72);
|
||||
this.关闭.TabIndex = 10;
|
||||
this.关闭.Text = "关闭";
|
||||
this.关闭.UseVisualStyleBackColor = true;
|
||||
this.关闭.Click += new System.EventHandler(this.关闭_Click);
|
||||
//
|
||||
// 查询
|
||||
//
|
||||
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(1604, 46);
|
||||
this.查询.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
|
||||
this.查询.Name = "查询";
|
||||
this.查询.Size = new System.Drawing.Size(162, 72);
|
||||
this.查询.TabIndex = 8;
|
||||
this.查询.Text = "查询";
|
||||
this.查询.UseVisualStyleBackColor = true;
|
||||
this.查询.Click += new System.EventHandler(this.查询_Click);
|
||||
//
|
||||
// dataGridView1
|
||||
//
|
||||
this.dataGridView1.AllowUserToAddRows = false;
|
||||
this.dataGridView1.AllowUserToDeleteRows = false;
|
||||
dataGridViewCellStyle1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.dataGridView1.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
|
||||
this.dataGridView1.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)));
|
||||
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
|
||||
dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control;
|
||||
dataGridViewCellStyle2.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText;
|
||||
dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight;
|
||||
dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
|
||||
dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
|
||||
this.dataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
|
||||
this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
|
||||
this.id,
|
||||
this.linename,
|
||||
this.flowname});
|
||||
dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
|
||||
dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Window;
|
||||
dataGridViewCellStyle3.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
dataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.ControlText;
|
||||
dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight;
|
||||
dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
|
||||
dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
|
||||
this.dataGridView1.DefaultCellStyle = dataGridViewCellStyle3;
|
||||
this.dataGridView1.Location = new System.Drawing.Point(6, 5);
|
||||
this.dataGridView1.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
|
||||
this.dataGridView1.Name = "dataGridView1";
|
||||
this.dataGridView1.ReadOnly = true;
|
||||
this.dataGridView1.RowHeadersWidth = 72;
|
||||
this.tableLayoutPanel1.SetRowSpan(this.dataGridView1, 4);
|
||||
this.dataGridView1.RowTemplate.Height = 23;
|
||||
this.dataGridView1.Size = new System.Drawing.Size(1584, 819);
|
||||
this.dataGridView1.TabIndex = 7;
|
||||
//
|
||||
// id
|
||||
//
|
||||
this.id.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
|
||||
this.id.DataPropertyName = "id";
|
||||
this.id.HeaderText = "序号";
|
||||
this.id.MinimumWidth = 9;
|
||||
this.id.Name = "id";
|
||||
this.id.ReadOnly = true;
|
||||
//
|
||||
// linename
|
||||
//
|
||||
this.linename.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
|
||||
this.linename.DataPropertyName = "linename";
|
||||
this.linename.HeaderText = "产线名称";
|
||||
this.linename.MinimumWidth = 9;
|
||||
this.linename.Name = "linename";
|
||||
this.linename.ReadOnly = true;
|
||||
//
|
||||
// flowname
|
||||
//
|
||||
this.flowname.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
|
||||
this.flowname.DataPropertyName = "plcname";
|
||||
this.flowname.HeaderText = "关联PLC";
|
||||
this.flowname.MinimumWidth = 9;
|
||||
this.flowname.Name = "flowname";
|
||||
this.flowname.ReadOnly = true;
|
||||
this.flowname.Resizable = System.Windows.Forms.DataGridViewTriState.True;
|
||||
this.flowname.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
|
||||
this.flowname.ToolTipText = "plcname";
|
||||
//
|
||||
// tableLayoutPanel1
|
||||
//
|
||||
this.tableLayoutPanel1.ColumnCount = 2;
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 90F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10F));
|
||||
this.tableLayoutPanel1.Controls.Add(this.关闭, 1, 3);
|
||||
this.tableLayoutPanel1.Controls.Add(this.dataGridView1, 0, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.查询, 1, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.新增, 1, 2);
|
||||
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
|
||||
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
|
||||
this.tableLayoutPanel1.RowCount = 4;
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 40F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F));
|
||||
this.tableLayoutPanel1.Size = new System.Drawing.Size(1774, 829);
|
||||
this.tableLayoutPanel1.TabIndex = 11;
|
||||
//
|
||||
// 新增
|
||||
//
|
||||
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(1604, 542);
|
||||
this.新增.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
|
||||
this.新增.Name = "新增";
|
||||
this.新增.Size = new System.Drawing.Size(162, 72);
|
||||
this.新增.TabIndex = 11;
|
||||
this.新增.Text = "新增";
|
||||
this.新增.UseVisualStyleBackColor = true;
|
||||
this.新增.Click += new System.EventHandler(this.新增_Click);
|
||||
//
|
||||
// LINEPLC_Manage
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(11F, 21F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(1774, 829);
|
||||
this.Controls.Add(this.tableLayoutPanel1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
|
||||
this.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.Name = "LINEPLC_Manage";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "LINE_Mange";
|
||||
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
|
||||
this.Load += new System.EventHandler(this.LINE_Manage_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
|
||||
this.tableLayoutPanel1.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Button 关闭;
|
||||
private System.Windows.Forms.Button 查询;
|
||||
private System.Windows.Forms.DataGridView dataGridView1;
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
|
||||
private System.Windows.Forms.Button 新增;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn id;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn linename;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn flowname;
|
||||
}
|
||||
}
|
||||
@@ -1,148 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using WindowsFormsApp1.db;
|
||||
using WindowsFormsApp1.mod;
|
||||
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
|
||||
|
||||
namespace WindowsFormsApp1.form
|
||||
{
|
||||
public partial class LinePLC_Manage : Form
|
||||
{
|
||||
public LinePLC_Manage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void 查询_Click(object sender, EventArgs e)
|
||||
{
|
||||
GetInfo();
|
||||
}
|
||||
|
||||
private void 关闭_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void LINE_Manage_Load(object sender, EventArgs e)
|
||||
{
|
||||
dataGridView1.AutoGenerateColumns = false;
|
||||
|
||||
// 添加修改按钮列
|
||||
DataGridViewButtonColumn modifyColumn = new DataGridViewButtonColumn();
|
||||
modifyColumn.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
|
||||
modifyColumn.Name = "ModifyColumn";
|
||||
modifyColumn.HeaderText = "修改";
|
||||
modifyColumn.Text = "修改";
|
||||
modifyColumn.UseColumnTextForButtonValue = true;
|
||||
dataGridView1.Columns.Add(modifyColumn);
|
||||
|
||||
// 添加删除按钮列
|
||||
DataGridViewButtonColumn deleteColumn = new DataGridViewButtonColumn();
|
||||
deleteColumn.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
|
||||
deleteColumn.Name = "DeleteColumn";
|
||||
deleteColumn.HeaderText = "删除";
|
||||
deleteColumn.Text = "删除";
|
||||
deleteColumn.UseColumnTextForButtonValue = true;
|
||||
dataGridView1.Columns.Add(deleteColumn);
|
||||
|
||||
dataGridView1.CellContentClick += DataGridView1_CellContentClick;
|
||||
GetInfo();
|
||||
}
|
||||
private void DataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
|
||||
{
|
||||
// 检查点击的是否为按钮列
|
||||
if (e.RowIndex >= 0)
|
||||
{
|
||||
DataGridView dataGridView = (DataGridView)sender;
|
||||
DataGridViewRow row = dataGridView.Rows[e.RowIndex];
|
||||
|
||||
int selectid = int.Parse(row.Cells[0].Value.ToString());
|
||||
if (e.ColumnIndex == 3)
|
||||
{
|
||||
LinePLC_Insert fLOW_Insert = new LinePLC_Insert();
|
||||
fLOW_Insert.dataid = selectid;
|
||||
fLOW_Insert.Operation = OperationType.Edit;
|
||||
fLOW_Insert.ShowDialog();
|
||||
GetInfo();
|
||||
|
||||
}
|
||||
else if (e.ColumnIndex == 4)
|
||||
{
|
||||
DialogResult result = MessageBox.Show("你确定要删除数据吗?", "确认提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
|
||||
|
||||
if (result == DialogResult.OK)
|
||||
{
|
||||
SQLiteHelper<t_lineplc> sQLiteHelper = new db.SQLiteHelper<t_lineplc>();
|
||||
var delresult = sQLiteHelper.Delete(selectid);
|
||||
if (delresult.Success)
|
||||
{
|
||||
MessageBox.Show("删除成功");
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("删除失败");
|
||||
}
|
||||
GetInfo();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public void GetInfo()
|
||||
{
|
||||
try
|
||||
{
|
||||
SQLiteHelper<t_plc> sQLiteHelper = new db.SQLiteHelper<t_plc>();
|
||||
SQLiteHelper<t_line> sQLiteHelper1 = new db.SQLiteHelper<t_line>();
|
||||
SQLiteHelper<t_lineplc> sQLiteHelper2 = new db.SQLiteHelper<t_lineplc>();
|
||||
var result_plc = sQLiteHelper.QueryAll();
|
||||
var result_line = sQLiteHelper1.QueryAll();
|
||||
var result_lineplc = sQLiteHelper2.QueryAll();
|
||||
|
||||
|
||||
if (!result_line.Success || !result_plc.Success || !result_lineplc.Success)
|
||||
{
|
||||
MessageBox.Show("查询失败!");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
List<object> list = new List<object>();
|
||||
foreach (var line in result_lineplc.Data)
|
||||
{
|
||||
var linename = result_line.Data.FirstOrDefault(a=>a.id == line.lineid);
|
||||
var plcname = result_plc.Data.FirstOrDefault(a => a.id == line.plcid);
|
||||
list.Add( new
|
||||
{
|
||||
id = line.id,
|
||||
lineid = line.lineid,
|
||||
plcid = line.plcid,
|
||||
linename = linename.linename,
|
||||
plcname = plcname.plcname,
|
||||
});
|
||||
}
|
||||
|
||||
dataGridView1.DataSource = null;
|
||||
dataGridView1.DataSource = list;
|
||||
dataGridView1.Refresh();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
private void 新增_Click(object sender, EventArgs e)
|
||||
{
|
||||
LinePLC_Insert fLOW_Insert = new LinePLC_Insert();
|
||||
fLOW_Insert.ShowDialog();
|
||||
GetInfo();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -42,17 +42,8 @@ namespace WindowsFormsApp1
|
||||
}
|
||||
else
|
||||
{
|
||||
SQLiteHelper<t_lineplc> sQLiteHelper_lineplc = new db.SQLiteHelper<t_lineplc>();
|
||||
var lineplc_result = sQLiteHelper_lineplc.Query(a => a.lineid == result_combox.Data.id);
|
||||
if (!lineplc_result.Success)
|
||||
{
|
||||
MessageBox.Show("无法初始化PLC-产线关联信息!");
|
||||
return;
|
||||
}
|
||||
|
||||
Init.t_User = result.Data;
|
||||
Init.t_Line = result_combox.Data;
|
||||
Init.t_Lineplcs = lineplc_result.Data;
|
||||
DialogResult = DialogResult.OK;
|
||||
this.Close();
|
||||
}
|
||||
|
||||
+40
-71
@@ -34,10 +34,6 @@
|
||||
this.关闭 = new System.Windows.Forms.Button();
|
||||
this.查询 = new System.Windows.Forms.Button();
|
||||
this.dataGridView1 = new System.Windows.Forms.DataGridView();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.comboBox1 = new System.Windows.Forms.ComboBox();
|
||||
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.id = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.plcname = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.code = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
@@ -47,6 +43,8 @@
|
||||
this.addresstype = new System.Windows.Forms.DataGridViewComboBoxColumn();
|
||||
this.addresstypelegth = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.remark = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
|
||||
this.tableLayoutPanel1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
@@ -114,77 +112,16 @@
|
||||
dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
|
||||
dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
|
||||
this.dataGridView1.DefaultCellStyle = dataGridViewCellStyle3;
|
||||
this.dataGridView1.Location = new System.Drawing.Point(6, 127);
|
||||
this.dataGridView1.Location = new System.Drawing.Point(6, 5);
|
||||
this.dataGridView1.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
|
||||
this.dataGridView1.Name = "dataGridView1";
|
||||
this.dataGridView1.ReadOnly = true;
|
||||
this.dataGridView1.RowHeadersWidth = 72;
|
||||
this.tableLayoutPanel1.SetRowSpan(this.dataGridView1, 3);
|
||||
this.tableLayoutPanel1.SetRowSpan(this.dataGridView1, 4);
|
||||
this.dataGridView1.RowTemplate.Height = 23;
|
||||
this.dataGridView1.Size = new System.Drawing.Size(1624, 682);
|
||||
this.dataGridView1.Size = new System.Drawing.Size(1624, 804);
|
||||
this.dataGridView1.TabIndex = 8;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.Anchor = System.Windows.Forms.AnchorStyles.Left;
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Font = new System.Drawing.Font("宋体", 14.14286F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.label1.Location = new System.Drawing.Point(4, 27);
|
||||
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(253, 68);
|
||||
this.label1.TabIndex = 12;
|
||||
this.label1.Text = "选择需要编辑的PLC编号:";
|
||||
//
|
||||
// comboBox1
|
||||
//
|
||||
this.comboBox1.Anchor = System.Windows.Forms.AnchorStyles.Left;
|
||||
this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.comboBox1.Font = new System.Drawing.Font("宋体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.comboBox1.FormattingEnabled = true;
|
||||
this.comboBox1.Location = new System.Drawing.Point(278, 40);
|
||||
this.comboBox1.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.comboBox1.Name = "comboBox1";
|
||||
this.comboBox1.Size = new System.Drawing.Size(409, 41);
|
||||
this.comboBox1.TabIndex = 13;
|
||||
//
|
||||
// tableLayoutPanel1
|
||||
//
|
||||
this.tableLayoutPanel1.ColumnCount = 3;
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 15.07911F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 74.9177F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10.00319F));
|
||||
this.tableLayoutPanel1.Controls.Add(this.button1, 2, 2);
|
||||
this.tableLayoutPanel1.Controls.Add(this.comboBox1, 1, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.dataGridView1, 0, 1);
|
||||
this.tableLayoutPanel1.Controls.Add(this.关闭, 2, 3);
|
||||
this.tableLayoutPanel1.Controls.Add(this.label1, 0, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.查询, 2, 0);
|
||||
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
|
||||
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
|
||||
this.tableLayoutPanel1.RowCount = 4;
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 15F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 45F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F));
|
||||
this.tableLayoutPanel1.Size = new System.Drawing.Size(1818, 814);
|
||||
this.tableLayoutPanel1.TabIndex = 14;
|
||||
//
|
||||
// button1
|
||||
//
|
||||
this.button1.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
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(1650, 541);
|
||||
this.button1.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(153, 56);
|
||||
this.button1.TabIndex = 15;
|
||||
this.button1.Text = "新增";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
this.button1.Click += new System.EventHandler(this.button1_Click);
|
||||
//
|
||||
// id
|
||||
//
|
||||
this.id.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
|
||||
@@ -270,6 +207,41 @@
|
||||
this.remark.Name = "remark";
|
||||
this.remark.ReadOnly = true;
|
||||
//
|
||||
// tableLayoutPanel1
|
||||
//
|
||||
this.tableLayoutPanel1.ColumnCount = 3;
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 15.07911F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 74.9177F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10.00319F));
|
||||
this.tableLayoutPanel1.Controls.Add(this.button1, 2, 2);
|
||||
this.tableLayoutPanel1.Controls.Add(this.关闭, 2, 3);
|
||||
this.tableLayoutPanel1.Controls.Add(this.查询, 2, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.dataGridView1, 0, 0);
|
||||
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
|
||||
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
|
||||
this.tableLayoutPanel1.RowCount = 4;
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 15F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 45F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F));
|
||||
this.tableLayoutPanel1.Size = new System.Drawing.Size(1818, 814);
|
||||
this.tableLayoutPanel1.TabIndex = 14;
|
||||
//
|
||||
// button1
|
||||
//
|
||||
this.button1.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
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(1650, 541);
|
||||
this.button1.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(153, 56);
|
||||
this.button1.TabIndex = 15;
|
||||
this.button1.Text = "新增";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
this.button1.Click += new System.EventHandler(this.button1_Click);
|
||||
//
|
||||
// PlcAddress_Manage
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(11F, 21F);
|
||||
@@ -285,7 +257,6 @@
|
||||
this.Load += new System.EventHandler(this.PLCADDRESS_Manage_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
|
||||
this.tableLayoutPanel1.ResumeLayout(false);
|
||||
this.tableLayoutPanel1.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
@@ -295,8 +266,6 @@
|
||||
private System.Windows.Forms.Button 关闭;
|
||||
private System.Windows.Forms.Button 查询;
|
||||
private System.Windows.Forms.DataGridView dataGridView1;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.ComboBox comboBox1;
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
|
||||
private System.Windows.Forms.Button button1;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn id;
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace WindowsFormsApp1.form
|
||||
|
||||
private void 查询_Click(object sender, EventArgs e)
|
||||
{
|
||||
GetInfo((int)comboBox1.SelectedValue);
|
||||
GetInfo();
|
||||
}
|
||||
|
||||
private void 保存_Click(object sender, EventArgs e)
|
||||
@@ -33,7 +33,7 @@ namespace WindowsFormsApp1.form
|
||||
if (result.Success)
|
||||
{
|
||||
MessageBox.Show("更新成功");
|
||||
GetInfo((int)comboBox1.SelectedValue);
|
||||
GetInfo();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -62,13 +62,6 @@ namespace WindowsFormsApp1.form
|
||||
return;
|
||||
}
|
||||
|
||||
var list = result_combox.Data.FindAll(a => Init.t_Lineplcs.Select(p => p.plcid).Contains(a.id));
|
||||
|
||||
// 绑定数据源到 ComboBox
|
||||
comboBox1.DataSource = list;
|
||||
comboBox1.DisplayMember = "plcname";
|
||||
comboBox1.ValueMember = "id";
|
||||
|
||||
var result1 = new List<object>
|
||||
{
|
||||
new {name = "read",value = "read"},
|
||||
@@ -134,7 +127,7 @@ namespace WindowsFormsApp1.form
|
||||
fLOW_Insert.dataid = selectid;
|
||||
fLOW_Insert.Operation = OperationType.Edit;
|
||||
fLOW_Insert.ShowDialog();
|
||||
GetInfo((int)comboBox1.SelectedValue);
|
||||
GetInfo();
|
||||
|
||||
}
|
||||
else if (e.ColumnIndex == 10)
|
||||
@@ -153,12 +146,12 @@ namespace WindowsFormsApp1.form
|
||||
{
|
||||
MessageBox.Show("删除失败");
|
||||
}
|
||||
GetInfo((int)comboBox1.SelectedValue);
|
||||
GetInfo();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public void GetInfo(int plcid)
|
||||
public void GetInfo()
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -166,7 +159,7 @@ namespace WindowsFormsApp1.form
|
||||
SQLiteHelper<t_plcaddress> sQLiteHelper = new db.SQLiteHelper<t_plcaddress>();
|
||||
SQLiteHelper<t_plc> sQLiteHelper1 = new db.SQLiteHelper<t_plc>();
|
||||
var result_plc = sQLiteHelper1.QueryAll();
|
||||
var result = sQLiteHelper.Query(a=>a.plcid == plcid);
|
||||
var result = sQLiteHelper.Query(a=>a.plcid == Init.t_Line.plcid);
|
||||
if (result.Success)
|
||||
{
|
||||
List<object> list = new List<object>();
|
||||
@@ -203,7 +196,7 @@ namespace WindowsFormsApp1.form
|
||||
{
|
||||
PlcAddress_Insert fLOW_Insert = new PlcAddress_Insert();
|
||||
fLOW_Insert.ShowDialog();
|
||||
GetInfo((int)comboBox1.SelectedValue);
|
||||
GetInfo();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -118,13 +118,11 @@ namespace WindowsFormsApp1.form
|
||||
try
|
||||
{
|
||||
SQLiteHelper<t_plc> sQLiteHelper = new db.SQLiteHelper<t_plc>();
|
||||
var result = sQLiteHelper.QueryAll();
|
||||
var result = sQLiteHelper.Query(a=>a.id == Init.t_Line.plcid);
|
||||
if (result.Success)
|
||||
{
|
||||
var list = result.Data.FindAll(a=>Init.t_Lineplcs.Select(p=>p.plcid).Contains(a.id));
|
||||
|
||||
dataGridView1.DataSource = null;
|
||||
dataGridView1.DataSource = list;
|
||||
dataGridView1.DataSource = result.Data;
|
||||
dataGridView1.Refresh();
|
||||
}
|
||||
}
|
||||
|
||||
+382
@@ -0,0 +1,382 @@
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using WindowsFormsApp1.server;
|
||||
|
||||
namespace WindowsFormsApp1
|
||||
{
|
||||
partial class ScanForm_DZ
|
||||
{
|
||||
/// <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.components = new System.ComponentModel.Container();
|
||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.button3 = new System.Windows.Forms.Button();
|
||||
this.button2 = new System.Windows.Forms.Button();
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.确认 = new System.Windows.Forms.Button();
|
||||
this.取消 = new System.Windows.Forms.Button();
|
||||
this.端子2结果 = new System.Windows.Forms.Label();
|
||||
this.端子3结果 = new System.Windows.Forms.Label();
|
||||
this.端子1 = new System.Windows.Forms.Label();
|
||||
this.端子2 = new System.Windows.Forms.Label();
|
||||
this.端子3 = new System.Windows.Forms.Label();
|
||||
this.端子1结果 = new System.Windows.Forms.Label();
|
||||
this.请扫描条码 = new System.Windows.Forms.Label();
|
||||
this.label6 = new System.Windows.Forms.Label();
|
||||
this.label7 = new System.Windows.Forms.Label();
|
||||
this.label8 = new System.Windows.Forms.Label();
|
||||
this.端子1校验 = new System.Windows.Forms.Label();
|
||||
this.端子2校验 = new System.Windows.Forms.Label();
|
||||
this.端子3校验 = new System.Windows.Forms.Label();
|
||||
this.timer1 = new System.Windows.Forms.Timer(this.components);
|
||||
this.groupBox1.SuspendLayout();
|
||||
this.tableLayoutPanel1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// groupBox1
|
||||
//
|
||||
this.groupBox1.Controls.Add(this.tableLayoutPanel1);
|
||||
this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.groupBox1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.groupBox1.Location = new System.Drawing.Point(0, 0);
|
||||
this.groupBox1.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.Padding = new System.Windows.Forms.Padding(6, 5, 6, 5);
|
||||
this.groupBox1.Size = new System.Drawing.Size(1647, 704);
|
||||
this.groupBox1.TabIndex = 5;
|
||||
this.groupBox1.TabStop = false;
|
||||
this.groupBox1.Text = "端子扫码";
|
||||
//
|
||||
// tableLayoutPanel1
|
||||
//
|
||||
this.tableLayoutPanel1.ColumnCount = 9;
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 5F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 5F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 15F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 5F));
|
||||
this.tableLayoutPanel1.Controls.Add(this.button3, 7, 4);
|
||||
this.tableLayoutPanel1.Controls.Add(this.button2, 7, 3);
|
||||
this.tableLayoutPanel1.Controls.Add(this.button1, 7, 2);
|
||||
this.tableLayoutPanel1.Controls.Add(this.确认, 1, 6);
|
||||
this.tableLayoutPanel1.Controls.Add(this.取消, 6, 6);
|
||||
this.tableLayoutPanel1.Controls.Add(this.端子2结果, 6, 3);
|
||||
this.tableLayoutPanel1.Controls.Add(this.端子3结果, 6, 4);
|
||||
this.tableLayoutPanel1.Controls.Add(this.端子1, 3, 2);
|
||||
this.tableLayoutPanel1.Controls.Add(this.端子2, 3, 3);
|
||||
this.tableLayoutPanel1.Controls.Add(this.端子3, 3, 4);
|
||||
this.tableLayoutPanel1.Controls.Add(this.端子1结果, 6, 2);
|
||||
this.tableLayoutPanel1.Controls.Add(this.请扫描条码, 2, 1);
|
||||
this.tableLayoutPanel1.Controls.Add(this.label6, 1, 2);
|
||||
this.tableLayoutPanel1.Controls.Add(this.label7, 1, 3);
|
||||
this.tableLayoutPanel1.Controls.Add(this.label8, 1, 4);
|
||||
this.tableLayoutPanel1.Controls.Add(this.端子1校验, 5, 2);
|
||||
this.tableLayoutPanel1.Controls.Add(this.端子2校验, 5, 3);
|
||||
this.tableLayoutPanel1.Controls.Add(this.端子3校验, 5, 4);
|
||||
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tableLayoutPanel1.Location = new System.Drawing.Point(6, 37);
|
||||
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
|
||||
this.tableLayoutPanel1.RowCount = 8;
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 5F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 17F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 17F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 17F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 17F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 5F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 17F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 5F));
|
||||
this.tableLayoutPanel1.Size = new System.Drawing.Size(1635, 662);
|
||||
this.tableLayoutPanel1.TabIndex = 0;
|
||||
//
|
||||
// button3
|
||||
//
|
||||
this.button3.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.button3.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.button3.Location = new System.Drawing.Point(1390, 372);
|
||||
this.button3.Name = "button3";
|
||||
this.button3.Size = new System.Drawing.Size(157, 106);
|
||||
this.button3.TabIndex = 14;
|
||||
this.button3.Text = "清空条码";
|
||||
this.button3.UseVisualStyleBackColor = true;
|
||||
this.button3.Click += new System.EventHandler(this.button3_Click);
|
||||
//
|
||||
// button2
|
||||
//
|
||||
this.button2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.button2.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.button2.Location = new System.Drawing.Point(1390, 260);
|
||||
this.button2.Name = "button2";
|
||||
this.button2.Size = new System.Drawing.Size(157, 106);
|
||||
this.button2.TabIndex = 13;
|
||||
this.button2.Text = "清空条码";
|
||||
this.button2.UseVisualStyleBackColor = true;
|
||||
this.button2.Click += new System.EventHandler(this.button2_Click_1);
|
||||
//
|
||||
// button1
|
||||
//
|
||||
this.button1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.button1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.button1.Location = new System.Drawing.Point(1390, 148);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(157, 106);
|
||||
this.button1.TabIndex = 12;
|
||||
this.button1.Text = "清空条码";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
this.button1.Click += new System.EventHandler(this.button1_Click_1);
|
||||
//
|
||||
// 确认
|
||||
//
|
||||
this.确认.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.确认.Font = new System.Drawing.Font("宋体", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.确认.Location = new System.Drawing.Point(84, 517);
|
||||
this.确认.Name = "确认";
|
||||
this.确认.Size = new System.Drawing.Size(321, 106);
|
||||
this.确认.TabIndex = 2;
|
||||
this.确认.Text = "确认";
|
||||
this.确认.UseVisualStyleBackColor = true;
|
||||
this.确认.Click += new System.EventHandler(this.button1_Click);
|
||||
//
|
||||
// 取消
|
||||
//
|
||||
this.tableLayoutPanel1.SetColumnSpan(this.取消, 2);
|
||||
this.取消.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.取消.Font = new System.Drawing.Font("宋体", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.取消.Location = new System.Drawing.Point(1227, 517);
|
||||
this.取消.Name = "取消";
|
||||
this.取消.Size = new System.Drawing.Size(320, 106);
|
||||
this.取消.TabIndex = 3;
|
||||
this.取消.Text = "取消";
|
||||
this.取消.UseVisualStyleBackColor = true;
|
||||
this.取消.Click += new System.EventHandler(this.button2_Click);
|
||||
//
|
||||
// 端子2结果
|
||||
//
|
||||
this.端子2结果.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
this.端子2结果.AutoSize = true;
|
||||
this.端子2结果.Font = new System.Drawing.Font("宋体", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.端子2结果.Location = new System.Drawing.Point(1274, 292);
|
||||
this.端子2结果.Name = "端子2结果";
|
||||
this.端子2结果.Size = new System.Drawing.Size(62, 42);
|
||||
this.端子2结果.TabIndex = 7;
|
||||
this.端子2结果.Text = "NG";
|
||||
//
|
||||
// 端子3结果
|
||||
//
|
||||
this.端子3结果.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
this.端子3结果.AutoSize = true;
|
||||
this.端子3结果.Font = new System.Drawing.Font("宋体", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.端子3结果.Location = new System.Drawing.Point(1274, 404);
|
||||
this.端子3结果.Name = "端子3结果";
|
||||
this.端子3结果.Size = new System.Drawing.Size(62, 42);
|
||||
this.端子3结果.TabIndex = 8;
|
||||
this.端子3结果.Text = "OK";
|
||||
//
|
||||
// 端子1
|
||||
//
|
||||
this.端子1.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
this.端子1.AutoSize = true;
|
||||
this.tableLayoutPanel1.SetColumnSpan(this.端子1, 2);
|
||||
this.端子1.Font = new System.Drawing.Font("宋体", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.端子1.Location = new System.Drawing.Point(645, 180);
|
||||
this.端子1.Name = "端子1";
|
||||
this.端子1.Size = new System.Drawing.Size(260, 42);
|
||||
this.端子1.TabIndex = 1;
|
||||
this.端子1.Text = "12112312312";
|
||||
//
|
||||
// 端子2
|
||||
//
|
||||
this.端子2.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
this.端子2.AutoSize = true;
|
||||
this.tableLayoutPanel1.SetColumnSpan(this.端子2, 2);
|
||||
this.端子2.Font = new System.Drawing.Font("宋体", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.端子2.Location = new System.Drawing.Point(645, 292);
|
||||
this.端子2.Name = "端子2";
|
||||
this.端子2.Size = new System.Drawing.Size(260, 42);
|
||||
this.端子2.TabIndex = 6;
|
||||
this.端子2.Text = "12112312312";
|
||||
//
|
||||
// 端子3
|
||||
//
|
||||
this.端子3.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
this.端子3.AutoSize = true;
|
||||
this.tableLayoutPanel1.SetColumnSpan(this.端子3, 2);
|
||||
this.端子3.Font = new System.Drawing.Font("宋体", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.端子3.Location = new System.Drawing.Point(645, 404);
|
||||
this.端子3.Name = "端子3";
|
||||
this.端子3.Size = new System.Drawing.Size(260, 42);
|
||||
this.端子3.TabIndex = 5;
|
||||
this.端子3.Text = "12112312312";
|
||||
//
|
||||
// 端子1结果
|
||||
//
|
||||
this.端子1结果.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
this.端子1结果.AutoSize = true;
|
||||
this.端子1结果.Font = new System.Drawing.Font("宋体", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.端子1结果.Location = new System.Drawing.Point(1274, 180);
|
||||
this.端子1结果.Name = "端子1结果";
|
||||
this.端子1结果.Size = new System.Drawing.Size(62, 42);
|
||||
this.端子1结果.TabIndex = 4;
|
||||
this.端子1结果.Text = "OK";
|
||||
//
|
||||
// 请扫描条码
|
||||
//
|
||||
this.请扫描条码.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
this.请扫描条码.AutoSize = true;
|
||||
this.tableLayoutPanel1.SetColumnSpan(this.请扫描条码, 3);
|
||||
this.请扫描条码.Font = new System.Drawing.Font("宋体", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.请扫描条码.ForeColor = System.Drawing.Color.Red;
|
||||
this.请扫描条码.Location = new System.Drawing.Point(508, 61);
|
||||
this.请扫描条码.Name = "请扫描条码";
|
||||
this.请扫描条码.Size = new System.Drawing.Size(452, 56);
|
||||
this.请扫描条码.TabIndex = 0;
|
||||
this.请扫描条码.Text = "请扫描端子条码:";
|
||||
//
|
||||
// label6
|
||||
//
|
||||
this.label6.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
this.label6.AutoSize = true;
|
||||
this.label6.Font = new System.Drawing.Font("宋体", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.label6.Location = new System.Drawing.Point(160, 180);
|
||||
this.label6.Name = "label6";
|
||||
this.label6.Size = new System.Drawing.Size(169, 42);
|
||||
this.label6.TabIndex = 9;
|
||||
this.label6.Text = "端子1:";
|
||||
//
|
||||
// label7
|
||||
//
|
||||
this.label7.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
this.label7.AutoSize = true;
|
||||
this.label7.Font = new System.Drawing.Font("宋体", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.label7.Location = new System.Drawing.Point(160, 292);
|
||||
this.label7.Name = "label7";
|
||||
this.label7.Size = new System.Drawing.Size(169, 42);
|
||||
this.label7.TabIndex = 10;
|
||||
this.label7.Text = "端子2:";
|
||||
//
|
||||
// label8
|
||||
//
|
||||
this.label8.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
this.label8.AutoSize = true;
|
||||
this.label8.Font = new System.Drawing.Font("宋体", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.label8.Location = new System.Drawing.Point(160, 404);
|
||||
this.label8.Name = "label8";
|
||||
this.label8.Size = new System.Drawing.Size(169, 42);
|
||||
this.label8.TabIndex = 11;
|
||||
this.label8.Text = "端子3:";
|
||||
//
|
||||
// 端子1校验
|
||||
//
|
||||
this.端子1校验.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
this.端子1校验.AutoSize = true;
|
||||
this.端子1校验.Font = new System.Drawing.Font("宋体", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.端子1校验.Location = new System.Drawing.Point(1111, 180);
|
||||
this.端子1校验.Name = "端子1校验";
|
||||
this.端子1校验.Size = new System.Drawing.Size(62, 42);
|
||||
this.端子1校验.TabIndex = 15;
|
||||
this.端子1校验.Text = "OK";
|
||||
//
|
||||
// 端子2校验
|
||||
//
|
||||
this.端子2校验.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
this.端子2校验.AutoSize = true;
|
||||
this.端子2校验.Font = new System.Drawing.Font("宋体", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.端子2校验.Location = new System.Drawing.Point(1111, 292);
|
||||
this.端子2校验.Name = "端子2校验";
|
||||
this.端子2校验.Size = new System.Drawing.Size(62, 42);
|
||||
this.端子2校验.TabIndex = 16;
|
||||
this.端子2校验.Text = "NG";
|
||||
//
|
||||
// 端子3校验
|
||||
//
|
||||
this.端子3校验.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
this.端子3校验.AutoSize = true;
|
||||
this.端子3校验.Font = new System.Drawing.Font("宋体", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.端子3校验.Location = new System.Drawing.Point(1111, 404);
|
||||
this.端子3校验.Name = "端子3校验";
|
||||
this.端子3校验.Size = new System.Drawing.Size(62, 42);
|
||||
this.端子3校验.TabIndex = 17;
|
||||
this.端子3校验.Text = "OK";
|
||||
//
|
||||
// timer1
|
||||
//
|
||||
this.timer1.Enabled = true;
|
||||
this.timer1.Interval = 800;
|
||||
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
|
||||
//
|
||||
// ScanForm_DZ
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(11F, 21F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(1647, 704);
|
||||
this.Controls.Add(this.groupBox1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
|
||||
this.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.Name = "ScanForm_DZ";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "扫码界面";
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.ScanForm_FormClosing);
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
this.tableLayoutPanel1.ResumeLayout(false);
|
||||
this.tableLayoutPanel1.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
private void ScanForm_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
FormHelp.RemoveAllEventHandlers(Init.ScanPort, "DataReceived");
|
||||
}
|
||||
|
||||
#endregion
|
||||
private System.Windows.Forms.GroupBox groupBox1;
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
|
||||
private System.Windows.Forms.Label 请扫描条码;
|
||||
private System.Windows.Forms.Label 端子1;
|
||||
private System.Windows.Forms.Button 确认;
|
||||
private System.Windows.Forms.Button 取消;
|
||||
private System.Windows.Forms.Timer timer1;
|
||||
private System.Windows.Forms.Label 端子2结果;
|
||||
private System.Windows.Forms.Label 端子3结果;
|
||||
private System.Windows.Forms.Label 端子2;
|
||||
private System.Windows.Forms.Label 端子3;
|
||||
private System.Windows.Forms.Label 端子1结果;
|
||||
private System.Windows.Forms.Label label6;
|
||||
private System.Windows.Forms.Label label7;
|
||||
private System.Windows.Forms.Label label8;
|
||||
private System.Windows.Forms.Button button3;
|
||||
private System.Windows.Forms.Button button2;
|
||||
private System.Windows.Forms.Button button1;
|
||||
private System.Windows.Forms.Label 端子1校验;
|
||||
private System.Windows.Forms.Label 端子2校验;
|
||||
private System.Windows.Forms.Label 端子3校验;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,202 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.IO.Ports;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using WindowsFormsApp1.db;
|
||||
using WindowsFormsApp1.mod;
|
||||
using WindowsFormsApp1.mod.database;
|
||||
using WindowsFormsApp1.mod.server;
|
||||
using WindowsFormsApp1.server;
|
||||
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
|
||||
|
||||
namespace WindowsFormsApp1
|
||||
{
|
||||
public partial class ScanForm_DZ : Form
|
||||
{
|
||||
public ApiClient ApiClient = new ApiClient();
|
||||
public ScanForm_DZ()
|
||||
{
|
||||
InitializeComponent();
|
||||
Init.ScanPort.DataReceived += SerialPort_DataReceived;
|
||||
端子1.Text = "";
|
||||
端子2.Text = "";
|
||||
端子3.Text = "";
|
||||
|
||||
}
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.DialogResult = DialogResult.OK;
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void button2_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.DialogResult = DialogResult.Cancel;
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void timer1_Tick(object sender, EventArgs e)
|
||||
{
|
||||
if (请扫描条码.ForeColor == Color.Red)
|
||||
{
|
||||
请扫描条码.ForeColor = Color.RosyBrown;
|
||||
}
|
||||
else
|
||||
{
|
||||
请扫描条码.ForeColor = Color.Red;
|
||||
}
|
||||
}
|
||||
|
||||
public void SerialPort_DataReceived(object sender, SerialDataReceivedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!Init.ScanPort.IsOpen)
|
||||
{
|
||||
Init.ScanPort?.Open();
|
||||
}
|
||||
// 读取串口接收到的数据
|
||||
var dataBuilder = new StringBuilder();
|
||||
while(Init.ScanPort.BytesToRead > 0)
|
||||
{
|
||||
System.Threading.Thread.Sleep(100);
|
||||
dataBuilder.Append(Init.ScanPort.ReadExisting());
|
||||
}
|
||||
var barcode = dataBuilder.ToString();
|
||||
if (端子1.Text == barcode || 端子2.Text == barcode || 端子3.Text == barcode)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (string.IsNullOrWhiteSpace(端子1.Text))
|
||||
{
|
||||
this.Invoke(new Action(() =>
|
||||
{
|
||||
端子1.Text = barcode;
|
||||
}));
|
||||
var result = ApiClient.CallFunctionByName("nowinterface.code", null, new otherdata() { JS_SN = barcode });
|
||||
if (result.Success)
|
||||
{
|
||||
this.Invoke(new Action(() =>
|
||||
{
|
||||
端子1校验.Text = "校验OK";
|
||||
}));
|
||||
//继续调用接口
|
||||
|
||||
this.Invoke(new Action(() =>
|
||||
{
|
||||
button1.Visible = false;
|
||||
}));
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Invoke(new Action(() =>
|
||||
{
|
||||
端子1校验.Text = "校验NG";
|
||||
}));
|
||||
}
|
||||
}
|
||||
else if (string.IsNullOrWhiteSpace(端子2.Text))
|
||||
{
|
||||
this.Invoke(new Action(() =>
|
||||
{
|
||||
端子2.Text = barcode;
|
||||
}));
|
||||
var result = ApiClient.CallFunctionByName("nowinterface.code", null, new otherdata() { JS_SN = barcode });
|
||||
if (result.Success)
|
||||
{
|
||||
this.Invoke(new Action(() =>
|
||||
{
|
||||
端子2校验.Text = "校验OK";
|
||||
}));
|
||||
//继续调用接口
|
||||
|
||||
this.Invoke(new Action(() =>
|
||||
{
|
||||
button2.Visible = false;
|
||||
}));
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Invoke(new Action(() =>
|
||||
{
|
||||
端子2校验.Text = "校验NG";
|
||||
}));
|
||||
}
|
||||
}
|
||||
else if (string.IsNullOrWhiteSpace(端子3.Text))
|
||||
{
|
||||
this.Invoke(new Action(() =>
|
||||
{
|
||||
端子3.Text = barcode;
|
||||
}));
|
||||
var result = ApiClient.CallFunctionByName("nowinterface.code", null, new otherdata() { JS_SN = barcode });
|
||||
if (result.Success)
|
||||
{
|
||||
this.Invoke(new Action(() =>
|
||||
{
|
||||
端子3校验.Text = "校验OK";
|
||||
}));
|
||||
|
||||
//继续调用接口
|
||||
this.Invoke(new Action(() =>
|
||||
{
|
||||
button3.Visible = false;
|
||||
}));
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Invoke(new Action(() =>
|
||||
{
|
||||
端子3校验.Text = "校验NG";
|
||||
}));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//if (this.InvokeRequired)
|
||||
//{
|
||||
// this.Invoke(new Action(() =>
|
||||
// {
|
||||
// 端子1.Text = ReturnValue;
|
||||
// 端子1.Visible = true;
|
||||
// }));
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// 端子1.Text = ReturnValue;
|
||||
// 端子1.Visible = true;
|
||||
//}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show($"读取数据时出错: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
private void button1_Click_1(object sender, EventArgs e)
|
||||
{
|
||||
端子1.Text = "";
|
||||
}
|
||||
|
||||
private void button2_Click_1(object sender, EventArgs e)
|
||||
{
|
||||
端子2.Text = "";
|
||||
}
|
||||
|
||||
private void button3_Click(object sender, EventArgs e)
|
||||
{
|
||||
端子3.Text = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
+3
@@ -117,4 +117,7 @@
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
+196
@@ -0,0 +1,196 @@
|
||||
namespace WindowsFormsApp1
|
||||
{
|
||||
partial class ScanForm_SSQ
|
||||
{
|
||||
/// <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.components = new System.ComponentModel.Container();
|
||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.button2 = new System.Windows.Forms.Button();
|
||||
this.请扫描条码 = new System.Windows.Forms.Label();
|
||||
this.LOt号 = new System.Windows.Forms.Label();
|
||||
this.确认 = new System.Windows.Forms.Button();
|
||||
this.取消 = new System.Windows.Forms.Button();
|
||||
this.timer1 = new System.Windows.Forms.Timer(this.components);
|
||||
this.groupBox1.SuspendLayout();
|
||||
this.tableLayoutPanel1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// groupBox1
|
||||
//
|
||||
this.groupBox1.Controls.Add(this.tableLayoutPanel1);
|
||||
this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.groupBox1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.groupBox1.Location = new System.Drawing.Point(0, 0);
|
||||
this.groupBox1.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.Padding = new System.Windows.Forms.Padding(6, 5, 6, 5);
|
||||
this.groupBox1.Size = new System.Drawing.Size(1647, 704);
|
||||
this.groupBox1.TabIndex = 5;
|
||||
this.groupBox1.TabStop = false;
|
||||
this.groupBox1.Text = "物料扫码";
|
||||
//
|
||||
// tableLayoutPanel1
|
||||
//
|
||||
this.tableLayoutPanel1.ColumnCount = 5;
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 11.11111F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 11.11111F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 11.11111F));
|
||||
this.tableLayoutPanel1.Controls.Add(this.button1, 1, 4);
|
||||
this.tableLayoutPanel1.Controls.Add(this.button2, 3, 4);
|
||||
this.tableLayoutPanel1.Controls.Add(this.请扫描条码, 1, 1);
|
||||
this.tableLayoutPanel1.Controls.Add(this.LOt号, 1, 2);
|
||||
this.tableLayoutPanel1.Controls.Add(this.确认, 1, 6);
|
||||
this.tableLayoutPanel1.Controls.Add(this.取消, 3, 6);
|
||||
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tableLayoutPanel1.Location = new System.Drawing.Point(6, 37);
|
||||
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
|
||||
this.tableLayoutPanel1.RowCount = 8;
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 4.588645F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 13.76593F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 18.35458F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 9.06084F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 13.76593F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 9.50806F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 13.76593F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 17.19009F));
|
||||
this.tableLayoutPanel1.Size = new System.Drawing.Size(1635, 662);
|
||||
this.tableLayoutPanel1.TabIndex = 0;
|
||||
//
|
||||
// button1
|
||||
//
|
||||
this.button1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.button1.Font = new System.Drawing.Font("宋体", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.button1.Location = new System.Drawing.Point(184, 304);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(539, 85);
|
||||
this.button1.TabIndex = 4;
|
||||
this.button1.Text = "位置1";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
this.button1.Click += new System.EventHandler(this.button1_Click_1);
|
||||
//
|
||||
// button2
|
||||
//
|
||||
this.button2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.button2.Font = new System.Drawing.Font("宋体", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.button2.Location = new System.Drawing.Point(910, 304);
|
||||
this.button2.Name = "button2";
|
||||
this.button2.Size = new System.Drawing.Size(539, 85);
|
||||
this.button2.TabIndex = 5;
|
||||
this.button2.Text = "位置2";
|
||||
this.button2.UseVisualStyleBackColor = true;
|
||||
this.button2.Click += new System.EventHandler(this.button2_Click_1);
|
||||
//
|
||||
// 请扫描条码
|
||||
//
|
||||
this.请扫描条码.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
this.请扫描条码.AutoSize = true;
|
||||
this.tableLayoutPanel1.SetColumnSpan(this.请扫描条码, 3);
|
||||
this.请扫描条码.Font = new System.Drawing.Font("宋体", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.请扫描条码.ForeColor = System.Drawing.Color.Red;
|
||||
this.请扫描条码.Location = new System.Drawing.Point(647, 47);
|
||||
this.请扫描条码.Name = "请扫描条码";
|
||||
this.请扫描条码.Size = new System.Drawing.Size(338, 56);
|
||||
this.请扫描条码.TabIndex = 0;
|
||||
this.请扫描条码.Text = "请扫描条码:";
|
||||
//
|
||||
// LOt号
|
||||
//
|
||||
this.LOt号.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
this.LOt号.AutoSize = true;
|
||||
this.tableLayoutPanel1.SetColumnSpan(this.LOt号, 3);
|
||||
this.LOt号.Font = new System.Drawing.Font("宋体", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.LOt号.Location = new System.Drawing.Point(544, 153);
|
||||
this.LOt号.Name = "LOt号";
|
||||
this.LOt号.Size = new System.Drawing.Size(544, 56);
|
||||
this.LOt号.TabIndex = 1;
|
||||
this.LOt号.Text = "LOt号:12112312312";
|
||||
//
|
||||
// 确认
|
||||
//
|
||||
this.确认.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.确认.Font = new System.Drawing.Font("宋体", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.确认.Location = new System.Drawing.Point(184, 457);
|
||||
this.确认.Name = "确认";
|
||||
this.确认.Size = new System.Drawing.Size(539, 85);
|
||||
this.确认.TabIndex = 2;
|
||||
this.确认.Text = "上线";
|
||||
this.确认.UseVisualStyleBackColor = true;
|
||||
this.确认.Click += new System.EventHandler(this.button1_Click);
|
||||
//
|
||||
// 取消
|
||||
//
|
||||
this.取消.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.取消.Font = new System.Drawing.Font("宋体", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.取消.Location = new System.Drawing.Point(910, 457);
|
||||
this.取消.Name = "取消";
|
||||
this.取消.Size = new System.Drawing.Size(539, 85);
|
||||
this.取消.TabIndex = 3;
|
||||
this.取消.Text = "下线";
|
||||
this.取消.UseVisualStyleBackColor = true;
|
||||
this.取消.Click += new System.EventHandler(this.button2_Click);
|
||||
//
|
||||
// timer1
|
||||
//
|
||||
this.timer1.Enabled = true;
|
||||
this.timer1.Interval = 800;
|
||||
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
|
||||
//
|
||||
// ScanForm_SSQ
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(11F, 21F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(1647, 704);
|
||||
this.Controls.Add(this.groupBox1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
|
||||
this.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.Name = "ScanForm_SSQ";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "扫码界面";
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
this.tableLayoutPanel1.ResumeLayout(false);
|
||||
this.tableLayoutPanel1.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
private System.Windows.Forms.GroupBox groupBox1;
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
|
||||
private System.Windows.Forms.Label 请扫描条码;
|
||||
private System.Windows.Forms.Label LOt号;
|
||||
private System.Windows.Forms.Button 确认;
|
||||
private System.Windows.Forms.Button 取消;
|
||||
private System.Windows.Forms.Timer timer1;
|
||||
private System.Windows.Forms.Button button1;
|
||||
private System.Windows.Forms.Button button2;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,139 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.IO.Ports;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using WindowsFormsApp1.db;
|
||||
using WindowsFormsApp1.mod;
|
||||
using WindowsFormsApp1.mod.database;
|
||||
using WindowsFormsApp1.server;
|
||||
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
|
||||
|
||||
namespace WindowsFormsApp1
|
||||
{
|
||||
public partial class ScanForm_SSQ : Form
|
||||
{
|
||||
// 自定义属性,用于存储返回值
|
||||
/// <summary>
|
||||
/// 0代表无位置
|
||||
/// </summary>
|
||||
int index = 0;
|
||||
public string ReturnValue { get; set; }
|
||||
public ScanForm_SSQ()
|
||||
{
|
||||
InitializeComponent();
|
||||
//Init.ScanPort.DataReceived += SerialPort_DataReceived;
|
||||
LOt号.Visible = false;
|
||||
|
||||
}
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(ReturnValue))
|
||||
{
|
||||
MessageBox.Show("扫码为空,请确认!");
|
||||
return;
|
||||
}
|
||||
|
||||
//请求后端接口,index代表位置
|
||||
//更新下数据库和init里面的keyvalue值
|
||||
}
|
||||
|
||||
private void button2_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(ReturnValue))
|
||||
{
|
||||
MessageBox.Show("扫码为空,请确认!");
|
||||
return;
|
||||
}
|
||||
//请求后端接口,index代表位置
|
||||
//更新下数据库和init里面的keyvalue值
|
||||
}
|
||||
|
||||
private void timer1_Tick(object sender, EventArgs e)
|
||||
{
|
||||
if (请扫描条码.ForeColor == Color.Red)
|
||||
{
|
||||
请扫描条码.ForeColor = Color.RosyBrown;
|
||||
}
|
||||
else
|
||||
{
|
||||
请扫描条码.ForeColor = Color.Red;
|
||||
}
|
||||
}
|
||||
|
||||
public void SerialPort_DataReceived(object sender, SerialDataReceivedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!Init.ScanPort.IsOpen)
|
||||
{
|
||||
Init.ScanPort?.Open();
|
||||
}
|
||||
// 读取串口接收到的数据
|
||||
var dataBuilder = new StringBuilder();
|
||||
while(Init.ScanPort.BytesToRead > 0)
|
||||
{
|
||||
System.Threading.Thread.Sleep(100);
|
||||
dataBuilder.Append(Init.ScanPort.ReadExisting());
|
||||
}
|
||||
ReturnValue = dataBuilder.ToString();
|
||||
|
||||
if (this.InvokeRequired)
|
||||
{
|
||||
this.Invoke(new Action(() =>
|
||||
{
|
||||
LOt号.Text = ReturnValue;
|
||||
LOt号.Visible = true;
|
||||
}));
|
||||
}
|
||||
else
|
||||
{
|
||||
LOt号.Text = ReturnValue;
|
||||
LOt号.Visible = true;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show($"读取数据时出错: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
private void button1_Click_1(object sender, EventArgs e)
|
||||
{
|
||||
if (button1.BackColor == Color.Red)
|
||||
{
|
||||
index = 0;
|
||||
button1.BackColor = SystemColors.Control;
|
||||
button2.BackColor = SystemColors.Control;
|
||||
}
|
||||
else
|
||||
{
|
||||
index = 1;
|
||||
button1.BackColor = Color.Red;
|
||||
button2.BackColor = SystemColors.Control;
|
||||
}
|
||||
}
|
||||
|
||||
private void button2_Click_1(object sender, EventArgs e)
|
||||
{
|
||||
if (button2.BackColor == Color.Red)
|
||||
{
|
||||
index = 0;
|
||||
button2.BackColor = SystemColors.Control;
|
||||
button1.BackColor = SystemColors.Control;
|
||||
}
|
||||
else
|
||||
{
|
||||
index = 2;
|
||||
button2.BackColor = Color.Red;
|
||||
button1.BackColor = SystemColors.Control;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -117,13 +117,7 @@
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="linename.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="flowname.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
+45
-75
@@ -34,10 +34,6 @@
|
||||
this.关闭 = new System.Windows.Forms.Button();
|
||||
this.查询 = new System.Windows.Forms.Button();
|
||||
this.dataGridView1 = new System.Windows.Forms.DataGridView();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.comboBox1 = new System.Windows.Forms.ComboBox();
|
||||
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.id = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.plcname = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.code = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
@@ -47,6 +43,8 @@
|
||||
this.addresstype = new System.Windows.Forms.DataGridViewComboBoxColumn();
|
||||
this.addresstypelegth = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.remark = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
|
||||
this.tableLayoutPanel1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
@@ -83,8 +81,8 @@
|
||||
this.dataGridView1.AllowUserToDeleteRows = false;
|
||||
dataGridViewCellStyle1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.dataGridView1.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
|
||||
this.dataGridView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
this.dataGridView1.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)));
|
||||
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
|
||||
dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control;
|
||||
@@ -114,77 +112,16 @@
|
||||
dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
|
||||
dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
|
||||
this.dataGridView1.DefaultCellStyle = dataGridViewCellStyle3;
|
||||
this.dataGridView1.Location = new System.Drawing.Point(6, 127);
|
||||
this.dataGridView1.Location = new System.Drawing.Point(6, 5);
|
||||
this.dataGridView1.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
|
||||
this.dataGridView1.Name = "dataGridView1";
|
||||
this.dataGridView1.ReadOnly = true;
|
||||
this.dataGridView1.RowHeadersWidth = 72;
|
||||
this.tableLayoutPanel1.SetRowSpan(this.dataGridView1, 3);
|
||||
this.tableLayoutPanel1.SetRowSpan(this.dataGridView1, 4);
|
||||
this.dataGridView1.RowTemplate.Height = 23;
|
||||
this.dataGridView1.Size = new System.Drawing.Size(1624, 682);
|
||||
this.dataGridView1.Size = new System.Drawing.Size(1624, 804);
|
||||
this.dataGridView1.TabIndex = 8;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.Anchor = System.Windows.Forms.AnchorStyles.Left;
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Font = new System.Drawing.Font("宋体", 14.14286F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.label1.Location = new System.Drawing.Point(4, 27);
|
||||
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(253, 68);
|
||||
this.label1.TabIndex = 12;
|
||||
this.label1.Text = "选择需要编辑的PLC编号:";
|
||||
//
|
||||
// comboBox1
|
||||
//
|
||||
this.comboBox1.Anchor = System.Windows.Forms.AnchorStyles.Left;
|
||||
this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.comboBox1.Font = new System.Drawing.Font("宋体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.comboBox1.FormattingEnabled = true;
|
||||
this.comboBox1.Location = new System.Drawing.Point(278, 40);
|
||||
this.comboBox1.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.comboBox1.Name = "comboBox1";
|
||||
this.comboBox1.Size = new System.Drawing.Size(409, 41);
|
||||
this.comboBox1.TabIndex = 13;
|
||||
//
|
||||
// tableLayoutPanel1
|
||||
//
|
||||
this.tableLayoutPanel1.ColumnCount = 3;
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 15.07911F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 74.9177F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10.00319F));
|
||||
this.tableLayoutPanel1.Controls.Add(this.button1, 2, 2);
|
||||
this.tableLayoutPanel1.Controls.Add(this.comboBox1, 1, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.dataGridView1, 0, 1);
|
||||
this.tableLayoutPanel1.Controls.Add(this.关闭, 2, 3);
|
||||
this.tableLayoutPanel1.Controls.Add(this.label1, 0, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.查询, 2, 0);
|
||||
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
|
||||
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
|
||||
this.tableLayoutPanel1.RowCount = 4;
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 15F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 45F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F));
|
||||
this.tableLayoutPanel1.Size = new System.Drawing.Size(1818, 814);
|
||||
this.tableLayoutPanel1.TabIndex = 14;
|
||||
//
|
||||
// button1
|
||||
//
|
||||
this.button1.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
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(1650, 541);
|
||||
this.button1.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(153, 56);
|
||||
this.button1.TabIndex = 15;
|
||||
this.button1.Text = "新增";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
this.button1.Click += new System.EventHandler(this.button1_Click);
|
||||
//
|
||||
// id
|
||||
//
|
||||
this.id.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
|
||||
@@ -270,7 +207,43 @@
|
||||
this.remark.Name = "remark";
|
||||
this.remark.ReadOnly = true;
|
||||
//
|
||||
// PlcAddress_Manage
|
||||
// tableLayoutPanel1
|
||||
//
|
||||
this.tableLayoutPanel1.ColumnCount = 3;
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 15.07911F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 74.9177F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10.00319F));
|
||||
this.tableLayoutPanel1.Controls.Add(this.button1, 2, 2);
|
||||
this.tableLayoutPanel1.Controls.Add(this.关闭, 2, 3);
|
||||
this.tableLayoutPanel1.Controls.Add(this.查询, 2, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.dataGridView1, 0, 0);
|
||||
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
|
||||
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
|
||||
this.tableLayoutPanel1.RowCount = 4;
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 15F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 45F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
|
||||
this.tableLayoutPanel1.Size = new System.Drawing.Size(1818, 814);
|
||||
this.tableLayoutPanel1.TabIndex = 14;
|
||||
//
|
||||
// button1
|
||||
//
|
||||
this.button1.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
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(1650, 541);
|
||||
this.button1.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(153, 56);
|
||||
this.button1.TabIndex = 15;
|
||||
this.button1.Text = "新增";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
this.button1.Click += new System.EventHandler(this.button1_Click);
|
||||
//
|
||||
// Torqueaddress_Manage
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(11F, 21F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
@@ -278,14 +251,13 @@
|
||||
this.Controls.Add(this.tableLayoutPanel1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
|
||||
this.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.Name = "PlcAddress_Manage";
|
||||
this.Name = "Torqueaddress_Manage";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "PLCADDRESS_Manage";
|
||||
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
|
||||
this.Load += new System.EventHandler(this.PLCADDRESS_Manage_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
|
||||
this.tableLayoutPanel1.ResumeLayout(false);
|
||||
this.tableLayoutPanel1.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
@@ -295,8 +267,6 @@
|
||||
private System.Windows.Forms.Button 关闭;
|
||||
private System.Windows.Forms.Button 查询;
|
||||
private System.Windows.Forms.DataGridView dataGridView1;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.ComboBox comboBox1;
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
|
||||
private System.Windows.Forms.Button button1;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn id;
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace WindowsFormsApp1.form
|
||||
|
||||
private void 查询_Click(object sender, EventArgs e)
|
||||
{
|
||||
GetInfo((int)comboBox1.SelectedValue);
|
||||
GetInfo();
|
||||
}
|
||||
|
||||
private void 保存_Click(object sender, EventArgs e)
|
||||
@@ -33,7 +33,7 @@ namespace WindowsFormsApp1.form
|
||||
if (result.Success)
|
||||
{
|
||||
MessageBox.Show("更新成功");
|
||||
GetInfo((int)comboBox1.SelectedValue);
|
||||
GetInfo();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -62,13 +62,6 @@ namespace WindowsFormsApp1.form
|
||||
return;
|
||||
}
|
||||
|
||||
var list = result_combox.Data.FindAll(a => Init.t_Lineplcs.Select(p => p.plcid).Contains(a.id));
|
||||
|
||||
// 绑定数据源到 ComboBox
|
||||
comboBox1.DataSource = list;
|
||||
comboBox1.DisplayMember = "plcname";
|
||||
comboBox1.ValueMember = "id";
|
||||
|
||||
var result1 = new List<object>
|
||||
{
|
||||
new {name = "read",value = "read"},
|
||||
@@ -134,7 +127,7 @@ namespace WindowsFormsApp1.form
|
||||
fLOW_Insert.dataid = selectid;
|
||||
fLOW_Insert.Operation = OperationType.Edit;
|
||||
fLOW_Insert.ShowDialog();
|
||||
GetInfo((int)comboBox1.SelectedValue);
|
||||
GetInfo();
|
||||
|
||||
}
|
||||
else if (e.ColumnIndex == 10)
|
||||
@@ -153,12 +146,12 @@ namespace WindowsFormsApp1.form
|
||||
{
|
||||
MessageBox.Show("删除失败");
|
||||
}
|
||||
GetInfo((int)comboBox1.SelectedValue);
|
||||
GetInfo();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public void GetInfo(int plcid)
|
||||
public void GetInfo()
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -166,7 +159,7 @@ namespace WindowsFormsApp1.form
|
||||
SQLiteHelper<t_torqueaddress> sQLiteHelper = new db.SQLiteHelper<t_torqueaddress>();
|
||||
SQLiteHelper<t_plc> sQLiteHelper1 = new db.SQLiteHelper<t_plc>();
|
||||
var result_plc = sQLiteHelper1.QueryAll();
|
||||
var result = sQLiteHelper.Query(a=>a.plcid == plcid);
|
||||
var result = sQLiteHelper.Query(a=>a.plcid == Init.t_Line.plcid);
|
||||
if (result.Success)
|
||||
{
|
||||
List<object> list = new List<object>();
|
||||
@@ -203,7 +196,7 @@ namespace WindowsFormsApp1.form
|
||||
{
|
||||
Torqueaddress_Insert fLOW_Insert = new Torqueaddress_Insert();
|
||||
fLOW_Insert.ShowDialog();
|
||||
GetInfo((int)comboBox1.SelectedValue);
|
||||
GetInfo();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,170 +0,0 @@
|
||||
namespace WindowsFormsApp1.form
|
||||
{
|
||||
partial class LinePLC_Insert
|
||||
{
|
||||
/// <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.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.button2 = new System.Windows.Forms.Button();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.label6 = new System.Windows.Forms.Label();
|
||||
this.产线 = new System.Windows.Forms.ComboBox();
|
||||
this.PLC = new System.Windows.Forms.ComboBox();
|
||||
this.tableLayoutPanel1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// tableLayoutPanel1
|
||||
//
|
||||
this.tableLayoutPanel1.ColumnCount = 6;
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10F));
|
||||
this.tableLayoutPanel1.Controls.Add(this.button1, 1, 8);
|
||||
this.tableLayoutPanel1.Controls.Add(this.button2, 3, 8);
|
||||
this.tableLayoutPanel1.Controls.Add(this.label4, 1, 1);
|
||||
this.tableLayoutPanel1.Controls.Add(this.label6, 1, 3);
|
||||
this.tableLayoutPanel1.Controls.Add(this.产线, 2, 1);
|
||||
this.tableLayoutPanel1.Controls.Add(this.PLC, 2, 3);
|
||||
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tableLayoutPanel1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
|
||||
this.tableLayoutPanel1.RowCount = 10;
|
||||
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.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.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.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F));
|
||||
this.tableLayoutPanel1.Size = new System.Drawing.Size(1087, 854);
|
||||
this.tableLayoutPanel1.TabIndex = 0;
|
||||
//
|
||||
// button1
|
||||
//
|
||||
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.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(194, 79);
|
||||
this.button1.TabIndex = 14;
|
||||
this.button1.Text = "保存";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
this.button1.Click += new System.EventHandler(this.button1_Click);
|
||||
//
|
||||
// button2
|
||||
//
|
||||
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.Name = "button2";
|
||||
this.button2.Size = new System.Drawing.Size(190, 79);
|
||||
this.button2.TabIndex = 15;
|
||||
this.button2.Text = "取消";
|
||||
this.button2.UseVisualStyleBackColor = true;
|
||||
this.button2.Click += new System.EventHandler(this.button2_Click);
|
||||
//
|
||||
// label4
|
||||
//
|
||||
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, 113);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(124, 28);
|
||||
this.label4.TabIndex = 3;
|
||||
this.label4.Text = "产线名称";
|
||||
//
|
||||
// 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(161, 283);
|
||||
this.label6.Name = "label6";
|
||||
this.label6.Size = new System.Drawing.Size(110, 28);
|
||||
this.label6.TabIndex = 5;
|
||||
this.label6.Text = "关联PLC";
|
||||
//
|
||||
// 产线
|
||||
//
|
||||
this.产线.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
this.tableLayoutPanel1.SetColumnSpan(this.产线, 3);
|
||||
this.产线.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.产线.FormattingEnabled = true;
|
||||
this.产线.Location = new System.Drawing.Point(341, 113);
|
||||
this.产线.Name = "产线";
|
||||
this.产线.Size = new System.Drawing.Size(619, 36);
|
||||
this.产线.TabIndex = 31;
|
||||
//
|
||||
// PLC
|
||||
//
|
||||
this.PLC.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
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(341, 283);
|
||||
this.PLC.Name = "PLC";
|
||||
this.PLC.Size = new System.Drawing.Size(619, 36);
|
||||
this.PLC.TabIndex = 32;
|
||||
//
|
||||
// LinePLC_Insert
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(11F, 21F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(1087, 854);
|
||||
this.Controls.Add(this.tableLayoutPanel1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
|
||||
this.Name = "LinePLC_Insert";
|
||||
this.Text = "Form_Insert";
|
||||
this.Load += new System.EventHandler(this.FLOW_Insert_Load);
|
||||
this.tableLayoutPanel1.ResumeLayout(false);
|
||||
this.tableLayoutPanel1.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private System.Windows.Forms.Label label6;
|
||||
private System.Windows.Forms.Button button1;
|
||||
private System.Windows.Forms.Button button2;
|
||||
private System.Windows.Forms.ComboBox 产线;
|
||||
private System.Windows.Forms.ComboBox PLC;
|
||||
}
|
||||
}
|
||||
@@ -1,130 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using WindowsFormsApp1.db;
|
||||
using WindowsFormsApp1.mod;
|
||||
|
||||
namespace WindowsFormsApp1.form
|
||||
{
|
||||
public partial class LinePLC_Insert : Form
|
||||
{
|
||||
public OperationType Operation { get; set; }
|
||||
public int dataid { get; set; }
|
||||
|
||||
public LinePLC_Insert()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
//保存
|
||||
if (产线.SelectedValue == null)
|
||||
{
|
||||
MessageBox.Show("产线不可为空");
|
||||
}
|
||||
if (PLC.SelectedValue == null)
|
||||
{
|
||||
MessageBox.Show("PLC不可为空");
|
||||
}
|
||||
|
||||
t_lineplc t_Flow = new t_lineplc();
|
||||
t_Flow.lineid = (int)产线.SelectedValue;
|
||||
t_Flow.plcid = (int)PLC.SelectedValue;
|
||||
|
||||
|
||||
SQLiteHelper<t_lineplc> sQLiteHelper1 = new db.SQLiteHelper<t_lineplc>();
|
||||
if (Operation == OperationType.Edit)
|
||||
{
|
||||
t_Flow.id = dataid;
|
||||
sQLiteHelper1.Update(t_Flow);
|
||||
}
|
||||
else
|
||||
{
|
||||
sQLiteHelper1.Insert(t_Flow);
|
||||
}
|
||||
MessageBox.Show("保存成功");
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void button2_Click(object sender, EventArgs e)
|
||||
{
|
||||
//取消
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void FLOW_Insert_Load(object sender, EventArgs e)
|
||||
{
|
||||
SQLiteHelper<t_line> sQLiteHelper1 = new db.SQLiteHelper<t_line>();
|
||||
var result_combox1 = sQLiteHelper1.QueryAll();
|
||||
if (!result_combox1.Success)
|
||||
{
|
||||
MessageBox.Show("查询失败");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// 绑定数据源到 ComboBox
|
||||
产线.DataSource = result_combox1.Data;
|
||||
产线.DisplayMember = "linename";
|
||||
产线.ValueMember = "id";
|
||||
|
||||
|
||||
SQLiteHelper<t_plc> sQLiteHelper2 = new db.SQLiteHelper<t_plc>();
|
||||
var result_combox2 = sQLiteHelper2.QueryAll();
|
||||
if (!result_combox2.Success)
|
||||
{
|
||||
MessageBox.Show("查询失败");
|
||||
return;
|
||||
}
|
||||
|
||||
PLC.DataSource = result_combox2.Data;
|
||||
PLC.DisplayMember = "plcname";
|
||||
PLC.ValueMember = "id";
|
||||
|
||||
if (Operation == OperationType.Edit)
|
||||
{
|
||||
SQLiteHelper<t_lineplc> sQLiteHelper = new db.SQLiteHelper<t_lineplc>();
|
||||
var result = sQLiteHelper.QuerySingle(a=>a.id == dataid);
|
||||
if (!result.Success)
|
||||
{
|
||||
MessageBox.Show("查询失败");
|
||||
return;
|
||||
}
|
||||
var DataToEdit = result.Data;
|
||||
SelectItemByValue1(产线, DataToEdit.lineid.ToString());
|
||||
SelectItemByValue2(PLC, DataToEdit.plcid.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
private void SelectItemByValue1(ComboBox comboBox1, string value)
|
||||
{
|
||||
foreach (t_line item in comboBox1.Items)
|
||||
{
|
||||
if (item.id.ToString() == value)
|
||||
{
|
||||
comboBox1.SelectedItem = item;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void SelectItemByValue2(ComboBox comboBox1, string value)
|
||||
{
|
||||
foreach (t_plc item in comboBox1.Items)
|
||||
{
|
||||
if (item.id.ToString() == value)
|
||||
{
|
||||
comboBox1.SelectedItem = item;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+114
-12
@@ -41,6 +41,14 @@
|
||||
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.label5 = new System.Windows.Forms.Label();
|
||||
this.label6 = new System.Windows.Forms.Label();
|
||||
this.label8 = new System.Windows.Forms.Label();
|
||||
this.label9 = new System.Windows.Forms.Label();
|
||||
this.关联PLC = new System.Windows.Forms.ComboBox();
|
||||
this.tableLayoutPanel1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
@@ -65,6 +73,14 @@
|
||||
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.label5, 3, 1);
|
||||
this.tableLayoutPanel1.Controls.Add(this.label6, 3, 2);
|
||||
this.tableLayoutPanel1.Controls.Add(this.label8, 3, 3);
|
||||
this.tableLayoutPanel1.Controls.Add(this.label9, 1, 6);
|
||||
this.tableLayoutPanel1.Controls.Add(this.关联PLC, 2, 6);
|
||||
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tableLayoutPanel1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
@@ -123,11 +139,10 @@
|
||||
// 名称
|
||||
//
|
||||
this.名称.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
this.tableLayoutPanel1.SetColumnSpan(this.名称, 3);
|
||||
this.名称.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.名称.Location = new System.Drawing.Point(364, 108);
|
||||
this.名称.Location = new System.Drawing.Point(328, 108);
|
||||
this.名称.Name = "名称";
|
||||
this.名称.Size = new System.Drawing.Size(573, 39);
|
||||
this.名称.Size = new System.Drawing.Size(211, 39);
|
||||
this.名称.TabIndex = 16;
|
||||
//
|
||||
// label4
|
||||
@@ -166,21 +181,19 @@
|
||||
// 模组
|
||||
//
|
||||
this.模组.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
this.tableLayoutPanel1.SetColumnSpan(this.模组, 3);
|
||||
this.模组.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.模组.Location = new System.Drawing.Point(364, 363);
|
||||
this.模组.Location = new System.Drawing.Point(328, 363);
|
||||
this.模组.Name = "模组";
|
||||
this.模组.Size = new System.Drawing.Size(573, 39);
|
||||
this.模组.Size = new System.Drawing.Size(211, 39);
|
||||
this.模组.TabIndex = 20;
|
||||
//
|
||||
// 产线类型
|
||||
//
|
||||
this.产线类型.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
this.tableLayoutPanel1.SetColumnSpan(this.产线类型, 3);
|
||||
this.产线类型.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.产线类型.Location = new System.Drawing.Point(364, 278);
|
||||
this.产线类型.Location = new System.Drawing.Point(328, 278);
|
||||
this.产线类型.Name = "产线类型";
|
||||
this.产线类型.Size = new System.Drawing.Size(573, 39);
|
||||
this.产线类型.Size = new System.Drawing.Size(211, 39);
|
||||
this.产线类型.TabIndex = 17;
|
||||
//
|
||||
// label7
|
||||
@@ -197,11 +210,10 @@
|
||||
// 产线编号
|
||||
//
|
||||
this.产线编号.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
this.tableLayoutPanel1.SetColumnSpan(this.产线编号, 3);
|
||||
this.产线编号.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.产线编号.Location = new System.Drawing.Point(364, 193);
|
||||
this.产线编号.Location = new System.Drawing.Point(328, 193);
|
||||
this.产线编号.Name = "产线编号";
|
||||
this.产线编号.Size = new System.Drawing.Size(573, 39);
|
||||
this.产线编号.Size = new System.Drawing.Size(211, 39);
|
||||
this.产线编号.TabIndex = 30;
|
||||
//
|
||||
// 关联流程
|
||||
@@ -215,6 +227,88 @@
|
||||
this.关联流程.Size = new System.Drawing.Size(573, 36);
|
||||
this.关联流程.TabIndex = 31;
|
||||
//
|
||||
// 备用显示1
|
||||
//
|
||||
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;
|
||||
//
|
||||
// 备用显示2
|
||||
//
|
||||
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;
|
||||
//
|
||||
// 备用显示3
|
||||
//
|
||||
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;
|
||||
//
|
||||
// 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.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(138, 28);
|
||||
this.label5.TabIndex = 35;
|
||||
this.label5.Text = "备用显示1";
|
||||
//
|
||||
// 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.Name = "label6";
|
||||
this.label6.Size = new System.Drawing.Size(138, 28);
|
||||
this.label6.TabIndex = 36;
|
||||
this.label6.Text = "备用显示2";
|
||||
//
|
||||
// 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.Name = "label8";
|
||||
this.label8.Size = new System.Drawing.Size(138, 28);
|
||||
this.label8.TabIndex = 37;
|
||||
this.label8.Text = "备用显示3";
|
||||
//
|
||||
// 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.Name = "label9";
|
||||
this.label9.Size = new System.Drawing.Size(110, 28);
|
||||
this.label9.TabIndex = 38;
|
||||
this.label9.Text = "关联PLC";
|
||||
//
|
||||
// 关联PLC
|
||||
//
|
||||
this.关联PLC.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
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.Name = "关联PLC";
|
||||
this.关联PLC.Size = new System.Drawing.Size(573, 36);
|
||||
this.关联PLC.TabIndex = 39;
|
||||
//
|
||||
// Line_Insert
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(11F, 21F);
|
||||
@@ -246,5 +340,13 @@
|
||||
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.Label label5;
|
||||
private System.Windows.Forms.Label label6;
|
||||
private System.Windows.Forms.Label label8;
|
||||
private System.Windows.Forms.Label label9;
|
||||
private System.Windows.Forms.ComboBox 关联PLC;
|
||||
}
|
||||
}
|
||||
@@ -46,11 +46,31 @@ namespace WindowsFormsApp1.form
|
||||
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 (关联流程.SelectedValue == null || (int)关联流程.SelectedValue == 0)
|
||||
{
|
||||
MessageBox.Show("关联流程不能为空");
|
||||
return;
|
||||
}
|
||||
if (关联PLC.SelectedValue == null || (int)关联PLC.SelectedValue == 0)
|
||||
{
|
||||
MessageBox.Show("关联PLC不能为空");
|
||||
return;
|
||||
}
|
||||
|
||||
t_line t_Flow = new t_line();
|
||||
t_Flow.linename = 名称.Text;
|
||||
@@ -58,6 +78,11 @@ namespace WindowsFormsApp1.form
|
||||
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;
|
||||
|
||||
|
||||
SQLiteHelper<t_line> sQLiteHelper1 = new db.SQLiteHelper<t_line>();
|
||||
if (Operation == OperationType.Edit)
|
||||
@@ -82,8 +107,10 @@ namespace WindowsFormsApp1.form
|
||||
private void FLOW_Insert_Load(object sender, EventArgs e)
|
||||
{
|
||||
SQLiteHelper<t_flow> sQLiteHelper1 = new db.SQLiteHelper<t_flow>();
|
||||
SQLiteHelper<t_plc> sQLiteHelper2 = new db.SQLiteHelper<t_plc>();
|
||||
var result_combox1 = sQLiteHelper1.QueryAll();
|
||||
if (!result_combox1.Success)
|
||||
var result_combox2 = sQLiteHelper2.QueryAll();
|
||||
if (!result_combox1.Success || !result_combox2.Success)
|
||||
{
|
||||
MessageBox.Show("查询失败");
|
||||
return;
|
||||
@@ -103,6 +130,23 @@ namespace WindowsFormsApp1.form
|
||||
关联流程.DisplayMember = "flowname";
|
||||
关联流程.ValueMember = "id";
|
||||
|
||||
|
||||
List<plc_combox> list2 = new List<plc_combox>();
|
||||
var plcresult = result_combox2.Data;
|
||||
foreach (var group in plcresult)
|
||||
{
|
||||
list2.Add(new plc_combox
|
||||
{
|
||||
id = group.id,
|
||||
plcname = group.plcname
|
||||
});
|
||||
}
|
||||
|
||||
// 绑定数据源到 ComboBox
|
||||
关联PLC.DataSource = list2;
|
||||
关联PLC.DisplayMember = "plcname";
|
||||
关联PLC.ValueMember = "id";
|
||||
|
||||
if (Operation == OperationType.Edit)
|
||||
{
|
||||
SQLiteHelper<t_line> sQLiteHelper = new db.SQLiteHelper<t_line>();
|
||||
@@ -117,7 +161,11 @@ namespace WindowsFormsApp1.form
|
||||
产线编号.Text = DataToEdit.linecode;
|
||||
产线类型.Text = DataToEdit.linetype;
|
||||
模组.Text = DataToEdit.linemode;
|
||||
备用显示1.Text = DataToEdit.lineremark1;
|
||||
备用显示2.Text = DataToEdit.lineremark2;
|
||||
备用显示3.Text = DataToEdit.lineremark3;
|
||||
SelectItemByValue(关联流程, DataToEdit.flowid.ToString());
|
||||
SelectItemByValue2(关联PLC, DataToEdit.plcid.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,11 +180,29 @@ namespace WindowsFormsApp1.form
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void SelectItemByValue2(ComboBox comboBox1, string value)
|
||||
{
|
||||
foreach (plc_combox item in comboBox1.Items)
|
||||
{
|
||||
if (item.id.ToString() == value)
|
||||
{
|
||||
comboBox1.SelectedItem = item;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class flow_combox
|
||||
{
|
||||
public int id { get; set; }
|
||||
public string flowname{ get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
public class plc_combox
|
||||
{
|
||||
public int id { get; set; }
|
||||
public string plcname { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user