private void toolStripButton3_Click(object sender, EventArgs e) { if (listView2.Items.Count == 0) { DialogResult dialo = MessageBox.Show("请选择上传列表!", "选择上传列表", MessageBoxButtons.OKCancel); if (dialo == DialogResult.OK) { listView1.Focus(); } return; } MyUploadInfo up = new MyUploadInfo(); mainForm.CurrentOpenChildForm = up; foreach (ListViewItem item in listView2.Items) { SysguardWS.HostInfo hostinfo = (SysguardWS.HostInfo)item.Tag; up.HostIdList.Add(hostinfo.hostId); } up.Show(); }
private void GetData() { dataLayer = (IDataLayer)Settings.Default.Context["datalayer"]; DataLayerResult result = dataLayer.GetAllHostInfo(); DataLayerResult result2 = dataLayer.GetAllGroupInfo(); if (result == DataLayerResult.Success && result2 == DataLayerResult.Success) { SysguardWS.HostInfo info = null; foreach (SysguardWS.HostInfo info2 in dataLayer.HostInfoList.Values) { if (info2.hostId == host_id) { info = info2; break; } } if (info != null) { this.ipAddressControl1.Text = info.hostIp; this.textBox1.Text = info.hostName; this.textBox7.Text = info.diskpartition; this.textBox8.Text = info.description; foreach (SysguardWS.GroupInfo info_group in dataLayer.GroupInfoList.Values) { int index = this.comboBox1.Items.Add(info_group.groupName); if (info.groupId == info_group.groupId) { this.comboBox1.SelectedItem = info_group.groupName; } } } } }