private void NodeNumfind_Click(object sender, EventArgs e) { if (Nodepanel.Visible == false) { Nodepanel.Visible = true; LineNamepanel.Visible = false; return; } else { if (Usename == "") { MessageBox.Show("请选择母线名!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } else { WaitLinelist.ClearSelected(); //int firstnum = Convert.ToInt32(FirstNd.Text); //int lastnum = Convert.ToInt32(LastNode.Text); //pspulic.Type = "Polyline"; PSPDEV psp = new PSPDEV(); psp.SvgUID = pspulic.SvgUID; psp.Name = Usename; psp.Type = "Use"; psp = (PSPDEV)Services.BaseService.GetObject("SelectPSPDEVByName", psp); if (psp == null) { MessageBox.Show("你所选的母线不存在!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } bool flag = false; for (int i = 0; i < WaitLinelist.Items.Count; i++) { psdevclass psd = (psdevclass)WaitLinelist.Items[i]; if (psp.Number == psd.firstnum || psp.Number == psd.lastnum) { WaitLinelist.SelectedIndex = i; flag = true; } } if (!flag) { MessageBox.Show("没有找到相应的线路,请重新输入或者尝试另外的查询方式!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } } } }
private void NodeName_Click(object sender, EventArgs e) { if (LineNamepanel.Visible == false) { Nodepanel.Visible = false; LineNamepanel.Visible = true; } else { if (LinenametextBox.Text == "") { MessageBox.Show("请输入线路名称!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } else { WaitLinelist.ClearSelected(); string linename = LinenametextBox.Text; bool flag = false; for (int i = 0; i < WaitLinelist.Items.Count; i++) { psdevclass psd = (psdevclass)WaitLinelist.Items[i]; if (psd.linename.Contains(linename)) { WaitLinelist.SelectedIndex = i; flag = true; } } if (!flag) { MessageBox.Show("没有找到相应的线路,请重新输入或者尝试另外的查询方式!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } } } }