//タブが変更されたとき private void tabControl1_SelectedIndexChanged(object sender, EventArgs e) { Class_Detaget dataget = new Class_Detaget(); Dictionary <string, string> param_dict = new Dictionary <string, string>(); List <MailaddressDS> Maillist = new List <MailaddressDS>(); if (tabcontrol1.SelectedIndex == 0) { if (addressList_ope == null) { //オペレータが選択されていたとき Maillist = dataget.selectMailList_ope(param_dict, con); addressList_ope = Maillist; disp_addressList(Maillist, m_operaterList); } } else if (tabcontrol1.SelectedIndex == 1) { if (addressList_tantou == null) { //カスタマ担当者が選択されていたとき Maillist = dataget.selectMailList_Tantou(param_dict, con); addressList_tantou = Maillist; disp_addressList(Maillist, m_user_tanntouList); } } }
//アドレス private void opeAddress() { m_addressslist.Clear(); Class_Detaget dg = new Class_Detaget(); List <MailaddressDS> addressList = new List <MailaddressDS>(); Dictionary <string, string> param_dict = new Dictionary <string, string>(); param_dict["opetantouno"] = m_tantouno.Text; //アドレスを取得 addressList = dg.selectMailList_Tantou(param_dict, con); this.m_addressslist.FullRowSelect = true; this.m_addressslist.HideSelection = false; this.m_addressslist.HeaderStyle = ColumnHeaderStyle.Clickable; this.m_addressslist.Columns.Insert(0, "アドレス番号", 50, HorizontalAlignment.Left); this.m_addressslist.Columns.Insert(1, "メールアドレス", 150, HorizontalAlignment.Left); this.m_addressslist.Columns.Insert(2, "アドレス名", 150, HorizontalAlignment.Left); this.m_addressslist.Columns.Insert(3, "更新日時", 120, HorizontalAlignment.Left); this.m_addressslist.Columns.Insert(4, "更新者", 120, HorizontalAlignment.Left); //リストに表示 if (addressList != null) { foreach (MailaddressDS ad_ds in addressList) { ListViewItem itemx1 = new ListViewItem(); itemx1.Text = ad_ds.addressNo; itemx1.SubItems.Add(ad_ds.mailAddress); itemx1.SubItems.Add(ad_ds.addressname); itemx1.SubItems.Add(ad_ds.chk_date); itemx1.SubItems.Add(ad_ds.chk_name_id); this.m_addressslist.Items.Add(itemx1); } //件数表示 this.m_mail_count.Text = addressList.Count.ToString() + "件"; } }
//アドレスの表示 private void Form_addressSelect_Load(object sender, EventArgs e) { _columnSorter1 = new Class_ListViewColumnSorter(); m_operaterList.ListViewItemSorter = _columnSorter1; _columnSorter2 = new Class_ListViewColumnSorter(); m_user_tanntouList.ListViewItemSorter = _columnSorter2; m_selectKoumoku.Items.Add("カスタマ担当者、オペレータID(通番)"); m_selectKoumoku.Items.Add("カスタマ名"); m_selectKoumoku.Items.Add("アドレス番号"); m_selectKoumoku.Items.Add("メールアドレス"); m_selectKoumoku.Items.Add("アドレス名"); m_selectKoumoku.Items.Add("更新者"); Class_Detaget dataget = new Class_Detaget(); Dictionary <string, string> param_dict = new Dictionary <string, string>(); List <MailaddressDS> Maillist = new List <MailaddressDS>(); if (tabcontrol1.SelectedIndex == 0) { //オペレータが選択されていたとき Maillist = dataget.selectMailList_ope(param_dict, con); addressList_ope = Maillist; disp_addressList(Maillist, m_operaterList); } else if (tabcontrol1.SelectedIndex == 1) { //カスタマ担当者が選択されていたとき Maillist = dataget.selectMailList_Tantou(param_dict, con); addressList_tantou = Maillist; disp_addressList(Maillist, m_user_tanntouList); } }