244 lines
8.3 KiB
C#
244 lines
8.3 KiB
C#
using System;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Windows.Forms;
|
|
using AGVSystem.Cls;
|
|
|
|
namespace AGVSystem
|
|
{
|
|
// Token: 0x02000010 RID: 16
|
|
public partial class InputSet : Form
|
|
{
|
|
// Token: 0x060000DF RID: 223 RVA: 0x00017C56 File Offset: 0x00015E56
|
|
public InputSet()
|
|
{
|
|
this.InitializeComponent();
|
|
}
|
|
|
|
// Token: 0x060000E0 RID: 224 RVA: 0x00017C8C File Offset: 0x00015E8C
|
|
private void comboBox8_SelectedIndexChanged(object sender, EventArgs e)
|
|
{
|
|
bool flag = this.comboBox8.SelectedIndex == 1;
|
|
if (flag)
|
|
{
|
|
this.label7.Visible = false;
|
|
this.numericUpDown2.Visible = false;
|
|
this.label9.Visible = false;
|
|
this.numericUpDown3.Visible = false;
|
|
this.numericUpDown2.Value = 0m;
|
|
this.numericUpDown3.Value = 0m;
|
|
}
|
|
else
|
|
{
|
|
this.label7.Visible = true;
|
|
this.numericUpDown2.Visible = true;
|
|
this.label9.Visible = true;
|
|
this.numericUpDown3.Visible = true;
|
|
}
|
|
}
|
|
|
|
// Token: 0x060000E1 RID: 225 RVA: 0x00017D3C File Offset: 0x00015F3C
|
|
private void toolStripButton1_Click(object sender, EventArgs e)
|
|
{
|
|
this.flag = 0;
|
|
this.groupBox1.Enabled = true;
|
|
this.comboBox1.SelectedIndex = 0;
|
|
this.comboBox2.SelectedIndex = 0;
|
|
this.comboBox3.SelectedIndex = 0;
|
|
this.comboBox4.SelectedIndex = 0;
|
|
this.comboBox5.SelectedIndex = 0;
|
|
this.comboBox6.SelectedIndex = 0;
|
|
this.comboBox7.SelectedIndex = 0;
|
|
this.comboBox8.SelectedIndex = 0;
|
|
this.comboBox9.SelectedIndex = 0;
|
|
this.textBox1.Text = "";
|
|
this.numericUpDown1.Value = 0m;
|
|
this.numericUpDown2.Value = 0m;
|
|
this.numericUpDown3.Value = 0m;
|
|
}
|
|
|
|
// Token: 0x060000E2 RID: 226 RVA: 0x00017E18 File Offset: 0x00016018
|
|
private void InputSet_Load(object sender, EventArgs e)
|
|
{
|
|
this.strsql = "SELECT [Card_ID] as 板卡编号 ,[Port] as 端口号 ,[Bit] as 端口位 ,[Value] as 输入值,[Class] as 区分 ,[Loc1] as 起始位ID ,[Loc2] as 中转位ID ,[Loc3] as 最终位ID ,[Remark] as 备注 FROM [IO_Accept]";
|
|
this.ds.Tables.Clear();
|
|
this.ds = this.db.connDt(this.strsql);
|
|
this.dataGridView1.DataSource = this.ds.Tables[0];
|
|
}
|
|
|
|
// Token: 0x060000E3 RID: 227 RVA: 0x00017E78 File Offset: 0x00016078
|
|
private void toolStripButton3_Click(object sender, EventArgs e)
|
|
{
|
|
bool flag = Param.UserName_temp == "";
|
|
if (flag)
|
|
{
|
|
MessageBox.Show("请登录管理员权限!", "AGV调度管理系统", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
|
|
}
|
|
else
|
|
{
|
|
this.flag = 0;
|
|
this.strsql = string.Concat(new string[]
|
|
{
|
|
"INSERT INTO [IO_Accept] ([Card_ID] ,[Port] ,[Bit] ,[Value] ,[Class] ,[Loc1] ,[Loc2] ,[Loc3] ,[Remark]) VALUES (",
|
|
this.comboBox1.SelectedIndex.ToString(),
|
|
",",
|
|
this.comboBox2.SelectedIndex.ToString(),
|
|
",",
|
|
this.comboBox3.SelectedIndex.ToString(),
|
|
",",
|
|
this.comboBox4.SelectedIndex.ToString(),
|
|
",",
|
|
this.comboBox8.SelectedIndex.ToString(),
|
|
",",
|
|
this.numericUpDown1.Value.ToString(),
|
|
",",
|
|
this.numericUpDown2.Value.ToString(),
|
|
",",
|
|
this.numericUpDown3.Value.ToString(),
|
|
",'",
|
|
this.textBox1.Text,
|
|
"')"
|
|
});
|
|
bool flag2 = this.db.Command(this.strsql) == "1";
|
|
if (flag2)
|
|
{
|
|
MessageBox.Show("添加成功!");
|
|
this.InputSet_Load(null, null);
|
|
this.toolStripButton1_Click(null, null);
|
|
}
|
|
}
|
|
}
|
|
|
|
// Token: 0x060000E4 RID: 228 RVA: 0x00018024 File Offset: 0x00016224
|
|
private void dataGridView1_DoubleClick(object sender, EventArgs e)
|
|
{
|
|
bool flag = this.dataGridView1.RowCount > 0;
|
|
if (flag)
|
|
{
|
|
this.flag = 0;
|
|
this.comboBox1.SelectedIndex = (int)Convert.ToInt16(this.dataGridView1.Rows[this.dataGridView1.CurrentRow.Index].Cells["板卡编号"].Value);
|
|
this.comboBox5.SelectedIndex = (int)Convert.ToInt16(this.dataGridView1.Rows[this.dataGridView1.CurrentRow.Index].Cells["板卡编号"].Value);
|
|
this.comboBox2.SelectedIndex = (int)Convert.ToInt16(this.dataGridView1.Rows[this.dataGridView1.CurrentRow.Index].Cells["端口号"].Value);
|
|
this.comboBox6.SelectedIndex = (int)Convert.ToInt16(this.dataGridView1.Rows[this.dataGridView1.CurrentRow.Index].Cells["端口号"].Value);
|
|
this.comboBox3.SelectedIndex = (int)Convert.ToInt16(this.dataGridView1.Rows[this.dataGridView1.CurrentRow.Index].Cells["端口位"].Value);
|
|
this.comboBox7.SelectedIndex = (int)Convert.ToInt16(this.dataGridView1.Rows[this.dataGridView1.CurrentRow.Index].Cells["端口位"].Value);
|
|
this.comboBox4.SelectedIndex = (int)Convert.ToInt16(this.dataGridView1.Rows[this.dataGridView1.CurrentRow.Index].Cells["输入值"].Value);
|
|
this.comboBox9.SelectedIndex = (int)Convert.ToInt16(this.dataGridView1.Rows[this.dataGridView1.CurrentRow.Index].Cells["输入值"].Value);
|
|
this.comboBox8.SelectedIndex = (int)Convert.ToInt16(this.dataGridView1.Rows[this.dataGridView1.CurrentRow.Index].Cells["区分"].Value);
|
|
this.numericUpDown1.Value = Convert.ToDecimal(this.dataGridView1.Rows[this.dataGridView1.CurrentRow.Index].Cells["起始位ID"].Value);
|
|
this.numericUpDown2.Value = Convert.ToDecimal(this.dataGridView1.Rows[this.dataGridView1.CurrentRow.Index].Cells["中转位ID"].Value);
|
|
this.numericUpDown3.Value = Convert.ToDecimal(this.dataGridView1.Rows[this.dataGridView1.CurrentRow.Index].Cells["最终位ID"].Value);
|
|
this.textBox1.Text = this.dataGridView1.Rows[this.dataGridView1.CurrentRow.Index].Cells["备注"].Value.ToString();
|
|
this.groupBox1.Enabled = false;
|
|
}
|
|
}
|
|
|
|
// Token: 0x060000E5 RID: 229 RVA: 0x000183DE File Offset: 0x000165DE
|
|
private void toolStripButton5_Click(object sender, EventArgs e)
|
|
{
|
|
this.groupBox1.Enabled = true;
|
|
this.flag = 1;
|
|
}
|
|
|
|
// Token: 0x060000E6 RID: 230 RVA: 0x000183F8 File Offset: 0x000165F8
|
|
private void toolStripButton6_Click(object sender, EventArgs e)
|
|
{
|
|
bool flag = Param.UserName_temp == "";
|
|
if (flag)
|
|
{
|
|
MessageBox.Show("请登录管理员权限!", "AGV调度管理系统", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
|
|
}
|
|
else
|
|
{
|
|
bool flag2 = this.flag == 1;
|
|
if (flag2)
|
|
{
|
|
this.strsql = string.Concat(new string[]
|
|
{
|
|
"UPDATE [IO_Accept] SET [Card_ID] = ",
|
|
this.comboBox1.SelectedIndex.ToString(),
|
|
",[Port] = ",
|
|
this.comboBox2.SelectedIndex.ToString(),
|
|
",[Bit] = ",
|
|
this.comboBox3.SelectedIndex.ToString(),
|
|
",[Value] = ",
|
|
this.comboBox4.SelectedIndex.ToString(),
|
|
",[Class] = ",
|
|
this.comboBox8.SelectedIndex.ToString(),
|
|
",[Loc1] = ",
|
|
this.numericUpDown1.Value.ToString(),
|
|
",[Loc2] = ",
|
|
this.numericUpDown2.Value.ToString(),
|
|
",[Loc3] = ",
|
|
this.numericUpDown3.Value.ToString(),
|
|
",[Remark] = '",
|
|
this.textBox1.Text,
|
|
"' WHERE [Card_ID] = ",
|
|
this.comboBox5.SelectedIndex.ToString(),
|
|
" and [Port] = ",
|
|
this.comboBox6.SelectedIndex.ToString(),
|
|
" and [Bit] = ",
|
|
this.comboBox7.SelectedIndex.ToString(),
|
|
" and [Value] = ",
|
|
this.comboBox9.SelectedIndex.ToString()
|
|
});
|
|
bool flag3 = this.db.Command(this.strsql) == "1";
|
|
if (flag3)
|
|
{
|
|
MessageBox.Show("更新成功!");
|
|
this.InputSet_Load(null, null);
|
|
this.toolStripButton1_Click(null, null);
|
|
this.flag = 0;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
// Token: 0x060000E7 RID: 231 RVA: 0x0001862C File Offset: 0x0001682C
|
|
private void toolStripButton4_Click(object sender, EventArgs e)
|
|
{
|
|
bool flag = Param.UserName_temp == "";
|
|
if (flag)
|
|
{
|
|
MessageBox.Show("请登录管理员权限!", "AGV调度管理系统", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
|
|
}
|
|
else
|
|
{
|
|
this.flag = 0;
|
|
this.strsql = string.Concat(new string[]
|
|
{
|
|
" DELETE FROM [IO_Accept] WHERE [Card_ID] = ",
|
|
this.comboBox5.SelectedIndex.ToString(),
|
|
" and [Port] =",
|
|
this.comboBox6.SelectedIndex.ToString(),
|
|
" and [Bit] = ",
|
|
this.comboBox7.SelectedIndex.ToString(),
|
|
" and Value = ",
|
|
this.comboBox9.SelectedIndex.ToString()
|
|
});
|
|
bool flag2 = this.db.Command(this.strsql) == "1";
|
|
if (flag2)
|
|
{
|
|
MessageBox.Show("删除成功!");
|
|
this.InputSet_Load(null, null);
|
|
this.toolStripButton1_Click(null, null);
|
|
this.flag = 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
// Token: 0x04000181 RID: 385
|
|
private string strsql;
|
|
|
|
// Token: 0x04000182 RID: 386
|
|
private ClsDBConn_sql db = new ClsDBConn_sql();
|
|
|
|
// Token: 0x04000183 RID: 387
|
|
private DataSet ds = new DataSet();
|
|
|
|
// Token: 0x04000184 RID: 388
|
|
private int flag = 0;
|
|
}
|
|
}
|