private void button2_Click(object sender, EventArgs e) { if (dataGridView1.CurrentCell == null) { MessageBox.Show("请选择需要修改的报警预案"); return; } int index = dataGridView1.CurrentCell.RowIndex; if (listBox1.SelectedItem != null) { string temp_AlarmName = listBox1.SelectedItem.ToString(); ArmAndDisarmList[] L_ArmAndDisarmList = ClassPlan.armAndDisarmList.ToArray(); ArmAndDisarmList temp_ArmAndDisarmList = Array.Find(L_ArmAndDisarmList, _ => _.AlarmName == temp_AlarmName); temp_Add_AlarmDeviceID = temp_ArmAndDisarmList.AlarmDeviceID; Guid Add_PlanDeviceID = new Guid(dataGridView1.Rows[index].Cells[9].Value.ToString()); PlanSet PS = new PlanSet(classplan, temp_Add_AlarmDeviceID, Add_PlanDeviceID, new Guid(temp_ArmAndDisarmList.DeviceID.ToString()), temp_ArmAndDisarmList.AlarmType); PS.Show(); } else { MessageBox.Show("请选择需要设置报警预案的报警器"); return; } }
public PlanSetForm(ClassPlan temp_ClassPlan) { InitializeComponent(); classplan = temp_ClassPlan; if (classplan == null) { MessageBox.Show("预案数据为空"); return; } PlanSet ps_1 = new PlanSet(classplan, this); ps_1.TopLevel = false; panel1.Controls.Add(ps_1); ps_1.Show(); }
private void button1_Click(object sender, EventArgs e) { //测试数据 //PlanSet PS = new PlanSet(classplan, new Guid()); //PS.Show(); if (listBox1.SelectedItem != null) { string temp_AlarmName = listBox1.SelectedItem.ToString(); ArmAndDisarmList[] L_ArmAndDisarmList = ClassPlan.armAndDisarmList.ToArray(); ArmAndDisarmList temp_ArmAndDisarmList = Array.Find(L_ArmAndDisarmList, _ => _.AlarmName == temp_AlarmName); temp_Add_AlarmDeviceID = temp_ArmAndDisarmList.AlarmDeviceID; PlanSet PS = new PlanSet(classplan, temp_Add_AlarmDeviceID, new Guid("00000000-0000-0000-0000-000000000000"), new Guid(temp_ArmAndDisarmList.DeviceID.ToString()), temp_ArmAndDisarmList.AlarmType); PS.Show(); } else { MessageBox.Show("请选择需要设置报警预案的报警器"); return; } }