using System; using System.ComponentModel; using System.Data; using System.Drawing; using System.Windows.Forms; using AGVSystem.Cls; namespace AGVSystem { // Token: 0x02000012 RID: 18 public partial class OutputSet : Form { // Token: 0x060000F1 RID: 241 RVA: 0x0001BFF0 File Offset: 0x0001A1F0 public OutputSet() { this.InitializeComponent(); } // Token: 0x060000F2 RID: 242 RVA: 0x0001C020 File Offset: 0x0001A220 private void comboBox4_TextChanged(object sender, EventArgs e) { bool flag = this.comboBox4.SelectedIndex == 0; if (flag) { this.label7.Text = ""; } else { bool flag2 = this.comboBox4.SelectedIndex == 1; if (flag2) { this.label7.Text = "低电平输出"; } else { bool flag3 = this.comboBox4.SelectedIndex == 2; if (flag3) { this.label7.Text = "高电平输出"; } } } } // Token: 0x060000F3 RID: 243 RVA: 0x0001C09C File Offset: 0x0001A29C private void toolStripButton1_Click(object sender, EventArgs e) { this.groupBox1.Enabled = true; this.numericUpDown1.Value = 0m; this.comboBox1.SelectedIndex = 1; this.comboBox2.SelectedIndex = 1; this.comboBox3.SelectedIndex = 1; this.comboBox4.SelectedIndex = 1; this.textBox1.Text = ""; } // Token: 0x060000F4 RID: 244 RVA: 0x0001C110 File Offset: 0x0001A310 private void OutputSet_Load(object sender, EventArgs e) { this.strsql = "SELECT [Loc_ID] as 位置编号,[Card_ID] as 板卡编号,[Port] as 端口号,[Bit] as 端口位,[Value] as 输出值,[Remark] as 备注 FROM [IO_Set]"; bool flag = this.ds.Tables.Count > 0; if (flag) { this.ds.Tables.Clear(); } this.ds = this.db.connDt(this.strsql); this.dataGridView1.DataSource = this.ds.Tables[0]; } // Token: 0x060000F5 RID: 245 RVA: 0x0001C188 File Offset: 0x0001A388 private void toolStripButton3_Click(object sender, EventArgs e) { bool flag = Param.UserName_temp == ""; if (flag) { MessageBox.Show("请登录管理员权限!", "AGV调度管理系统", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } else { bool flag2 = this.numericUpDown1.Value == 0m || this.comboBox1.Text == "" || this.comboBox2.Text == "" || this.comboBox3.Text == "" || this.comboBox4.Text == ""; if (!flag2) { this.strsql = string.Concat(new string[] { "INSERT INTO [IO_Set] ([Loc_ID],[Card_ID],[Port] ,[Bit] ,[Value] ,[Remark]) VALUES (", this.numericUpDown1.Value.ToString(), ",", this.comboBox1.SelectedIndex.ToString(), ",", this.comboBox2.SelectedIndex.ToString(), ",", this.comboBox3.SelectedIndex.ToString(), ",", this.comboBox4.Text, ",'", this.textBox1.Text, "')" }); bool flag3 = this.db.Command(this.strsql) == "1"; if (flag3) { MessageBox.Show("添加成功!"); this.OutputSet_Load(null, null); this.groupBox1.Enabled = false; } } } } // Token: 0x060000F6 RID: 246 RVA: 0x0001C348 File Offset: 0x0001A548 private void dataGridView1_DoubleClick(object sender, EventArgs e) { bool flag = this.dataGridView1.Rows.Count > 0; if (flag) { this.numericUpDown1.Value = Convert.ToDecimal(this.dataGridView1.CurrentRow.Cells[0].Value.ToString()); this.numericUpDown2.Value = Convert.ToDecimal(this.dataGridView1.CurrentRow.Cells[0].Value.ToString()); this.comboBox1.SelectedIndex = (int)Convert.ToInt16(this.dataGridView1.CurrentRow.Cells[1].Value.ToString()); this.comboBox5.SelectedIndex = (int)Convert.ToInt16(this.dataGridView1.CurrentRow.Cells[1].Value.ToString()); this.comboBox2.SelectedIndex = (int)Convert.ToInt16(this.dataGridView1.CurrentRow.Cells[2].Value.ToString()); this.comboBox6.SelectedIndex = (int)Convert.ToInt16(this.dataGridView1.CurrentRow.Cells[2].Value.ToString()); this.comboBox3.SelectedIndex = (int)Convert.ToInt16(this.dataGridView1.CurrentRow.Cells[3].Value.ToString()); this.comboBox7.SelectedIndex = (int)Convert.ToInt16(this.dataGridView1.CurrentRow.Cells[3].Value.ToString()); this.comboBox4.SelectedIndex = (int)Convert.ToInt16(this.dataGridView1.CurrentRow.Cells[4].Value.ToString()); this.textBox1.Text = this.dataGridView1.CurrentRow.Cells[5].Value.ToString(); this.groupBox1.Enabled = false; } } // Token: 0x060000F7 RID: 247 RVA: 0x0001C564 File Offset: 0x0001A764 private void toolStripButton5_Click(object sender, EventArgs e) { this.groupBox1.Enabled = true; } // Token: 0x060000F8 RID: 248 RVA: 0x0001C574 File Offset: 0x0001A774 private void toolStripButton4_Click(object sender, EventArgs e) { bool flag = Param.UserName_temp == ""; if (flag) { MessageBox.Show("请登录管理员权限!", "AGV调度管理系统", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } else { bool flag2 = this.numericUpDown1.Value == 0m || this.comboBox1.Text == "" || this.comboBox2.Text == "" || this.comboBox3.Text == "" || this.comboBox4.Text == ""; if (!flag2) { this.strsql = string.Concat(new string[] { "DELETE FROM io_set where [Loc_ID] =", this.numericUpDown1.Value.ToString(), " and [Card_ID] = ", this.comboBox1.SelectedIndex.ToString(), " and [Port] =", this.comboBox2.SelectedIndex.ToString(), " and [Bit] =", this.comboBox3.SelectedIndex.ToString() }); bool flag3 = this.db.Command(this.strsql) == "1"; if (flag3) { MessageBox.Show("删除成功!"); this.OutputSet_Load(null, null); this.groupBox1.Enabled = false; } } } } // Token: 0x060000F9 RID: 249 RVA: 0x0001C6F8 File Offset: 0x0001A8F8 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.numericUpDown1.Value == 0m || this.comboBox1.Text == "" || this.comboBox2.Text == "" || this.comboBox3.Text == ""; if (!flag2) { this.strsql = string.Concat(new string[] { "update io_set set [Loc_ID] = ", this.numericUpDown1.Value.ToString(), ",[Card_ID] = ", this.comboBox1.SelectedIndex.ToString(), ",[Port] = ", this.comboBox2.SelectedIndex.ToString(), ",[Bit] = ", this.comboBox3.SelectedIndex.ToString(), ",[Value] =", this.comboBox4.SelectedIndex.ToString(), ",[Remark] = '", this.textBox1.Text, "' where [Loc_ID] =", this.numericUpDown2.Value.ToString(), " and [Card_ID] = ", this.comboBox5.SelectedIndex.ToString(), " and [Port] =", this.comboBox6.SelectedIndex.ToString(), " and [Bit] =", this.comboBox7.SelectedIndex.ToString() }); bool flag3 = this.db.Command(this.strsql) == "1"; if (flag3) { MessageBox.Show("更新成功!"); this.OutputSet_Load(null, null); this.groupBox1.Enabled = false; } } } } // Token: 0x040001D7 RID: 471 private string strsql; // Token: 0x040001D8 RID: 472 private ClsDBConn_sql db = new ClsDBConn_sql(); // Token: 0x040001D9 RID: 473 private DataSet ds = new DataSet(); } }