예제 #1
0
        //検索ボタン
        private void m_selectBtn_Click(object sender, EventArgs e)
        {
            m_Customer_List.Clear();
            DISP_dataSet dset = new DISP_dataSet();
            Dictionary <string, string> param_dict = new Dictionary <string, string>();
            Class_Detaget dg = new Class_Detaget();

            if (m_selecttext.Text != "")
            {
                if (this.m_selectKoumoku.SelectedIndex.ToString() != "")

                {
                    switch (this.m_selectKoumoku.SelectedIndex)
                    {
                    //カスタマ通番
                    case 0:
                        param_dict["userno"] = m_selecttext.Text;
                        break;

                    //カスタマID
                    case 1:
                        param_dict["customerID"] = m_selecttext.Text;
                        break;

                    //カスタマ名
                    case 2:
                        param_dict["username"] = m_selecttext.Text;
                        break;

                    //カスタマ名カナ
                    case 3:
                        param_dict["username_kana"] = m_selecttext.Text;
                        break;

                    //カスタマ名略称
                    case 4:
                        param_dict["username_sum"] = m_selecttext.Text;
                        break;

                    //有効/無効
                    case 5:
                        if (m_selecttext.Text == "無効")
                        {
                            param_dict["status"] = "0";
                        }
                        else if (m_selecttext.Text == "有効")
                        {
                            param_dict["status"] = "1";
                        }

                        break;

                    //レポート出力有無
                    case 6:
                        if (m_selecttext.Text == "無効")
                        {
                            param_dict["report_status"] = "0";
                        }
                        else if (m_selecttext.Text == "有効")
                        {
                            param_dict["report_status"] = "1";
                        }

                        break;

                    //備考
                    case 7:
                        param_dict["biko"] = m_selecttext.Text;
                        break;

                    //更新日時
                    case 8:
                        DateTime dt;
                        String   str = m_selecttext.Text;

                        //入力された日付の形式の確認
                        if (DateTime.TryParse(str, out dt))
                        {
                            param_dict["chk_date"] = str;
                        }
                        else
                        {
                            MessageBox.Show("日付の形式が正しくありません。", "カスタマ検索");
                            return;
                        }
                        break;

                    //更新者
                    case 9:
                        param_dict["chk_name_id"] = m_selecttext.Text;
                        break;

                    default:
                        break;
                    }
                }
            }

            dset = dg.getSelectUser(param_dict, con, dset, true);

            this.splitContainer1.SplitterDistance = 220;

            this.m_Customer_List.FullRowSelect = true;
            this.m_Customer_List.HideSelection = false;
            this.m_Customer_List.HeaderStyle   = ColumnHeaderStyle.Clickable;

            this.m_Customer_List.Columns.Insert(0, "No", 30, HorizontalAlignment.Left);
            this.m_Customer_List.Columns.Insert(1, "カスタマID", 50, HorizontalAlignment.Left);
            this.m_Customer_List.Columns.Insert(2, "カスタマ名", 200, HorizontalAlignment.Left);
            this.m_Customer_List.Columns.Insert(3, "カスタマ名カナ", 200, HorizontalAlignment.Left);
            this.m_Customer_List.Columns.Insert(4, "カスタマ名略称", 100, HorizontalAlignment.Left);
            this.m_Customer_List.Columns.Insert(5, "有効/無効", 40, HorizontalAlignment.Left);
            this.m_Customer_List.Columns.Insert(6, "SLO対象", 40, HorizontalAlignment.Left);
            this.m_Customer_List.Columns.Insert(7, "備考", 300, HorizontalAlignment.Left);
            this.m_Customer_List.Columns.Insert(8, "更新日時", 120, HorizontalAlignment.Left);
            this.m_Customer_List.Columns.Insert(9, "更新者", 120, HorizontalAlignment.Left);

            //リストに表示
            if (dset.user_L != null)
            {
                foreach (userDS t_ds in dset.user_L)
                {
                    ListViewItem itemx1 = new ListViewItem();
                    itemx1.Text = t_ds.userno;

                    itemx1.SubItems.Add(t_ds.customerID);
                    itemx1.SubItems.Add(t_ds.username);
                    itemx1.SubItems.Add(t_ds.username_kana);
                    itemx1.SubItems.Add(t_ds.username_sum);
                    itemx1.SubItems.Add(t_ds.status);
                    itemx1.SubItems.Add(t_ds.report_status);
                    itemx1.SubItems.Add(t_ds.biko);
                    itemx1.SubItems.Add(t_ds.chk_date);
                    itemx1.SubItems.Add(t_ds.chk_name_id);

                    this.m_Customer_List.Items.Add(itemx1);
                }
            }
        }