//ダブルクリック private void m_host_List_DoubleClick(object sender, EventArgs e) { ListView.SelectedIndexCollection item = m_host_List.SelectedIndices; hostDS hostdt = new hostDS(); hostdt.host_no = this.m_host_List.Items[item[0]].SubItems[0].Text; hostdt.hostname = this.m_host_List.Items[item[0]].SubItems[1].Text; hostdt.status = this.m_host_List.Items[item[0]].SubItems[2].Text; hostdt.device = this.m_host_List.Items[item[0]].SubItems[3].Text; hostdt.location = this.m_host_List.Items[item[0]].SubItems[4].Text; hostdt.usefor = this.m_host_List.Items[item[0]].SubItems[5].Text; hostdt.settikikiid = this.m_host_List.Items[item[0]].SubItems[6].Text; hostdt.kansiStartdate = this.m_host_List.Items[item[0]].SubItems[7].Text; hostdt.kansiEndsdate = this.m_host_List.Items[item[0]].SubItems[8].Text; hostdt.hosyukanri = this.m_host_List.Items[item[0]].SubItems[9].Text; hostdt.hosyuinfo = this.m_host_List.Items[item[0]].SubItems[10].Text; hostdt.biko = this.m_host_List.Items[item[0]].SubItems[11].Text; hostdt.userno = this.m_host_List.Items[item[0]].SubItems[12].Text; hostdt.systemno = this.m_host_List.Items[item[0]].SubItems[13].Text; hostdt.siteno = this.m_host_List.Items[item[0]].SubItems[14].Text; hostdt.chk_date = this.m_host_List.Items[item[0]].SubItems[15].Text; hostdt.chk_name_id = this.m_host_List.Items[item[0]].SubItems[16].Text; gethost(hostdt); gethost(hostdt); }
//ホスト情報を表示する private void gethost(hostDS hostdt) { this.m_hostno.Text = hostdt.host_no; this.m_userno.Text = hostdt.userno; this.m_systemno.Text = hostdt.systemno; this.m_siteno.Text = hostdt.siteno; this.m_hostname.Text = hostdt.hostname; this.m_settikikiid.Text = hostdt.settikikiid; this.m_statusCombo.Text = hostdt.status; //元のステータスを保存しておく orgStatus = hostdt.status; this.m_kisyu.Text = hostdt.device; this.m_locate.Text = hostdt.location; this.m_usefor.Text = hostdt.usefor; if (hostdt.kansiStartdate == "") { m_start_date.Checked = false; } else { this.m_start_date.Text = hostdt.kansiStartdate; } if (hostdt.kansiEndsdate == "") { m_end_date.Checked = false; } else { this.m_end_date.Text = hostdt.kansiEndsdate; } this.m_kanrino.Text = hostdt.hosyukanri; this.m_hosyu.Text = hostdt.hosyuinfo; this.m_biko.Text = hostdt.biko; this.m_update.Text = hostdt.chk_date; this.m_updateOpe.Text = hostdt.chk_name_id; Class_Detaget dg = new Class_Detaget(); dg.con = con; if (hostdt.userno != "") { this.m_cutomername.Text = dg.getCustomername(hostdt.userno); } //システム情報 if (hostdt.systemno != "") { this.m_systemname.Text = dg.getSystemname(hostdt.systemno); } //拠点名取得 if (hostdt.siteno != "") { this.m_sitename.Text = dg.getSitename(hostdt.siteno); } }
void Read_hostCombo() { try { //ラベルに反映 if (m_siteCombo.SelectedValue != null) { m_siteno.Text = m_siteCombo.SelectedValue.ToString(); } m_hostCombo.DataSource = null; m_hostno.Text = ""; Class_Detaget getuser = new Class_Detaget(); //ホスト名を検索 List <hostDS> hostDSList = getuser.getHostList(m_siteno.Text, con, true); //空白行を追加 hostDS tmp = new hostDS(); tmp.hostname = ""; tmp.host_no = ""; List <hostDS> tmphostDSList = new List <hostDS>(); tmphostDSList.Add(tmp); //取得した行を空行についか if (hostDSList != null) { tmphostDSList.AddRange(hostDSList); } m_hostCombo.DataSource = tmphostDSList; m_hostCombo.DisplayMember = "hostname"; m_hostCombo.ValueMember = "host_no"; //ホスト名ラベルを表示 if (hostDSList.Count > 0) { if (m_hostCombo.Text != "") { m_hostno.Text = m_hostCombo.SelectedValue.ToString(); } } } catch (Exception ex) { MessageBox.Show("ホストコンボボックスの一覧を取得することができませんでした。 " + ex.Message, "ホスト情報取得"); } }
//ホスト名を読み込む private void Read_hostCombo(string siteno) { try { m_hostCombo.DataSource = null; m_hostno.Text = ""; Class_Detaget getuser = new Class_Detaget(); //ホスト名を検索 //空白行を追加 hostDS tmp = new hostDS(); tmp.hostname = ""; tmp.host_no = ""; List <hostDS> hostDSList = new List <hostDS>(); hostDSList.Add(tmp); //リストの取得 List <hostDS> hostDSList1 = getuser.getHostList(siteno, con, true); hostDSList.AddRange(hostDSList1); m_hostCombo.DataSource = hostDSList; m_hostCombo.DisplayMember = "hostname"; m_hostCombo.ValueMember = "host_no"; //ホスト名ラベルを表示 if (hostDSList.Count > 0) { m_hostno.Text = m_hostCombo.SelectedValue.ToString(); } } catch (Exception ex) { MessageBox.Show(ex.Message, "ホスト情報の読み込みに失敗", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }