Exemplo n.º 1
0
        private void button4_Click(object sender, EventArgs e)
        {
            String txt1 = comboBox1.SelectedItem as String;

            if (comboBox1.Text == "선택" || comboBox1.Text == "전체")
            {
                c1_Text = "";
            }
            else
            {
                string[] result = txt1.Split(new string[] { ":" }, StringSplitOptions.None);
                c1_Text = result[0];
            }
            String txt2 = comboBox2.SelectedItem as String;

            if (comboBox2.Text == "선택")
            {
                c2_Text = "bas_empno";
            }
            if (comboBox2.Text == "사원번호")
            {
                c2_Text = "bas_empno";
            }
            if (comboBox2.Text == "성명")
            {
                c2_Text = "bas_name";
            }
            String txt3 = comboBox3.SelectedItem as String;

            if (comboBox3.Text == "선택" || comboBox3.Text == "전체")
            {
                c3_Text = "";
            }
            else
            {
                string[] result = txt3.Split(new string[] { ":" }, StringSplitOptions.None);
                c3_Text = result[0];
            }
            String txt4 = comboBox4.SelectedItem as String;

            if (comboBox4.Text == "선택" || comboBox4.Text == "전체")
            {
                c4_Text = "";
            }
            else
            {
                string[] result = txt4.Split(new string[] { ":" }, StringSplitOptions.None);
                c4_Text = result[0];
            }

            if (dBManager.GetConnection() == true)
            {
                using (OracleCommand cmd = new OracleCommand())
                {
                    cmd.Connection = dBManager.Connection;

                    cmd.CommandText = "select * from INFORMATION_LJM where " + c2_Text + " like '%" + textBox3.Text + "%' and bas_dut like '%" + c3_Text + "%'" +
                                      " and dept_code like '%" + c1_Text + "%' and bas_pos like '%" + c4_Text + "%' order by bas_empno";
                    reader = cmd.ExecuteReader();
                    info_data.Clear();
                    while (reader.Read())
                    {
                        info_data.Add(new INFO(
                                          reader["bas_empno"].ToString(),
                                          reader["bas_resno"].ToString().Substring(0, 6),
                                          reader["bas_resno"].ToString().Substring(7, 7),
                                          reader["bas_name"].ToString(),
                                          reader["bas_cname"].ToString(),
                                          reader["bas_ename"].ToString(),
                                          reader["bas_fix"].ToString(),
                                          reader["bas_zip"].ToString(),
                                          reader["bas_addr"].ToString(),
                                          reader["bas_residence"].ToString(),
                                          reader["bas_hdpno"].ToString(),
                                          reader["bas_telno"].ToString(),
                                          reader["bas_email"].ToString(),
                                          reader["bas_mil_sta"].ToString(),
                                          reader["bas_mil_mil"].ToString() + ':' + reader["mil_codnms"].ToString(),
                                          reader["bas_mil_rnk"].ToString() + ':' + reader["rnk_codnms"].ToString(),
                                          reader["bas_mar"].ToString(),
                                          reader["bas_acc_bank1"].ToString() + ':' + reader["bnk1_codnms"].ToString(),
                                          reader["bas_acc_name1"].ToString(),
                                          reader["bas_acc_no1"].ToString(),
                                          reader["bas_acc_bank2"].ToString() + ':' + reader["bnk2_codnms"].ToString(),
                                          reader["bas_acc_name2"].ToString(),
                                          reader["bas_acc_no2"].ToString(),
                                          reader["bas_cont"].ToString(),
                                          reader["bas_intern"].ToString(),
                                          reader["bas_intern_no"].ToString(),
                                          reader["bas_emp_sdate"].ToString(),
                                          reader["bas_emp_edate"].ToString(),
                                          reader["bas_entdate"].ToString(),
                                          reader["bas_resdate"].ToString(),
                                          reader["bas_levdate"].ToString(),
                                          reader["bas_reidate"].ToString(),
                                          reader["bas_wsta"].ToString(),
                                          reader["bas_sts"].ToString() + ':' + reader["cd_codnms"].ToString(),
                                          reader["bas_pos"].ToString() + ':' + reader["pos_codnms"].ToString(),
                                          reader["bas_dut"].ToString() + ':' + reader["dut_codnms"].ToString(),
                                          reader["dept_code"].ToString() + ':' + reader["dept_name"].ToString(),
                                          reader["bas_rmk"].ToString(),
                                          reader["bas_pos_dt"].ToString(),
                                          reader["bas_dut_dt"].ToString(),
                                          reader["bas_dept_dt"].ToString(),
                                          reader["bas_intern_dt"].ToString()));
                    }
                    infoBindingList = new INFO.SortableBindingList <INFO>(info_data);
                    infoBindingSource.DataSource = infoBindingList;
                    dataGridView1.DataSource     = infoBindingSource;
                    #region //datagridview_columns_visible
                    this.dataGridView1.Columns["bas_empno"].HeaderText  = "사원번호";
                    this.dataGridView1.Columns["bas_resno1"].Visible    = false;
                    this.dataGridView1.Columns["bas_resno2"].Visible    = false;
                    this.dataGridView1.Columns["bas_name"].HeaderText   = "성명";
                    this.dataGridView1.Columns["bas_cname"].Visible     = false;
                    this.dataGridView1.Columns["bas_ename"].Visible     = false;
                    this.dataGridView1.Columns["bas_fix"].Visible       = false;
                    this.dataGridView1.Columns["bas_zip"].Visible       = false;
                    this.dataGridView1.Columns["bas_addr"].Visible      = false;
                    this.dataGridView1.Columns["bas_residence"].Visible = false;
                    this.dataGridView1.Columns["bas_hdpno"].HeaderText  = "핸드폰";
                    this.dataGridView1.Columns["bas_telno"].Visible     = false;
                    this.dataGridView1.Columns["bas_email"].HeaderText  = "이메일";
                    this.dataGridView1.Columns["bas_mil_sta"].Visible   = false;
                    this.dataGridView1.Columns["bas_mil_mil"].Visible   = false;
                    this.dataGridView1.Columns["bas_mil_rnk"].Visible   = false;
                    this.dataGridView1.Columns["bas_mar"].Visible       = false;
                    this.dataGridView1.Columns["bas_acc_bank1"].Visible = false;
                    this.dataGridView1.Columns["bas_acc_name1"].Visible = false;
                    this.dataGridView1.Columns["bas_acc_no1"].Visible   = false;
                    this.dataGridView1.Columns["bas_acc_bank2"].Visible = false;
                    this.dataGridView1.Columns["bas_acc_name2"].Visible = false;
                    this.dataGridView1.Columns["bas_acc_no2"].Visible   = false;
                    this.dataGridView1.Columns["bas_cont"].Visible      = false;
                    this.dataGridView1.Columns["bas_intern"].Visible    = false;
                    this.dataGridView1.Columns["bas_intern_no"].Visible = false;
                    this.dataGridView1.Columns["bas_emp_sdate"].Visible = false;
                    this.dataGridView1.Columns["bas_emp_edate"].Visible = false;
                    this.dataGridView1.Columns["bas_entdate"].Visible   = false;
                    this.dataGridView1.Columns["bas_resdate"].Visible   = false;
                    this.dataGridView1.Columns["bas_levdate"].Visible   = false;
                    this.dataGridView1.Columns["bas_reidate"].Visible   = false;
                    this.dataGridView1.Columns["bas_wsta"].Visible      = false;
                    this.dataGridView1.Columns["bas_sts"].Visible       = false;
                    this.dataGridView1.Columns["bas_pos"].HeaderText    = "직급";
                    this.dataGridView1.Columns["bas_dut"].HeaderText    = "직위";
                    this.dataGridView1.Columns["bas_dept"].HeaderText   = "부서";
                    this.dataGridView1.Columns["bas_rmk"].Visible       = false;
                    this.dataGridView1.Columns["bas_pos_dt"].Visible    = false;
                    this.dataGridView1.Columns["bas_dut_dt"].Visible    = false;
                    this.dataGridView1.Columns["bas_dept_dt"].Visible   = false;
                    this.dataGridView1.Columns["bas_intern_dt"].Visible = false;
                    #endregion
                }
            }
        }
Exemplo n.º 2
0
        public void DataLoad()
        {
            if (dBManager.GetConnection() == true)
            {
                using (OracleCommand cmd = new OracleCommand())
                {
                    cmd.Connection = dBManager.Connection;

                    cmd.CommandText = "select * from INFORMATION_LJM order by bas_empno";
                    reader          = cmd.ExecuteReader();
                    info_data.Clear();
                    while (reader.Read())
                    {
                        info_data.Add(new INFO(
                                          reader["bas_empno"].ToString(),
                                          reader["bas_resno"].ToString().Substring(0, 6),
                                          reader["bas_resno"].ToString().Substring(7, 7),
                                          reader["bas_name"].ToString(),
                                          reader["bas_cname"].ToString(),
                                          reader["bas_ename"].ToString(),
                                          reader["bas_fix"].ToString(),
                                          reader["bas_zip"].ToString(),
                                          reader["bas_addr"].ToString(),
                                          reader["bas_residence"].ToString(),
                                          reader["bas_hdpno"].ToString(),
                                          reader["bas_telno"].ToString(),
                                          reader["bas_email"].ToString(),
                                          reader["bas_mil_sta"].ToString(),
                                          reader["bas_mil_mil"].ToString() + ':' + reader["mil_codnms"].ToString(),
                                          reader["bas_mil_rnk"].ToString() + ':' + reader["rnk_codnms"].ToString(),
                                          reader["bas_mar"].ToString(),
                                          reader["bas_acc_bank1"].ToString() + ':' + reader["bnk1_codnms"].ToString(),
                                          reader["bas_acc_name1"].ToString(),
                                          reader["bas_acc_no1"].ToString(),
                                          reader["bas_acc_bank2"].ToString() + ':' + reader["bnk2_codnms"].ToString(),
                                          reader["bas_acc_name2"].ToString(),
                                          reader["bas_acc_no2"].ToString(),
                                          reader["bas_cont"].ToString(),
                                          reader["bas_intern"].ToString(),
                                          reader["bas_intern_no"].ToString(),
                                          reader["bas_emp_sdate"].ToString(),
                                          reader["bas_emp_edate"].ToString(),
                                          reader["bas_entdate"].ToString(),
                                          reader["bas_resdate"].ToString(),
                                          reader["bas_levdate"].ToString(),
                                          reader["bas_reidate"].ToString(),
                                          reader["bas_wsta"].ToString(),
                                          reader["bas_sts"].ToString() + ':' + reader["cd_codnms"].ToString(),
                                          reader["bas_pos"].ToString() + ':' + reader["pos_codnms"].ToString(),
                                          reader["bas_dut"].ToString() + ':' + reader["dut_codnms"].ToString(),
                                          reader["dept_code"].ToString() + ':' + reader["dept_name"].ToString(),
                                          reader["bas_rmk"].ToString(),
                                          reader["bas_pos_dt"].ToString(),
                                          reader["bas_dut_dt"].ToString(),
                                          reader["bas_dept_dt"].ToString(),
                                          reader["bas_intern_dt"].ToString()));
                    }
                    infoBindingList = new INFO.SortableBindingList <INFO>(info_data);
                    infoBindingSource.DataSource = infoBindingList;
                    dataGridView1.DataSource     = infoBindingSource;
                    #region //datagridview_columns_visible
                    this.dataGridView1.Columns["bas_empno"].HeaderText   = "사원번호";
                    this.dataGridView1.Columns["bas_resno1"].HeaderText  = "생년월일";
                    this.dataGridView1.Columns["bas_resno2"].Visible     = false;
                    this.dataGridView1.Columns["bas_name"].HeaderText    = "성명";
                    this.dataGridView1.Columns["bas_cname"].Visible      = false;
                    this.dataGridView1.Columns["bas_ename"].Visible      = false;
                    this.dataGridView1.Columns["bas_fix"].Visible        = false;
                    this.dataGridView1.Columns["bas_zip"].Visible        = false;
                    this.dataGridView1.Columns["bas_addr"].HeaderText    = "주소";
                    this.dataGridView1.Columns["bas_residence"].Visible  = false;
                    this.dataGridView1.Columns["bas_hdpno"].HeaderText   = "연락처";
                    this.dataGridView1.Columns["bas_telno"].Visible      = false;
                    this.dataGridView1.Columns["bas_email"].Visible      = false;
                    this.dataGridView1.Columns["bas_mil_sta"].Visible    = false;
                    this.dataGridView1.Columns["bas_mil_mil"].Visible    = false;
                    this.dataGridView1.Columns["bas_mil_rnk"].Visible    = false;
                    this.dataGridView1.Columns["bas_mar"].Visible        = false;
                    this.dataGridView1.Columns["bas_acc_bank1"].Visible  = false;
                    this.dataGridView1.Columns["bas_acc_name1"].Visible  = false;
                    this.dataGridView1.Columns["bas_acc_no1"].Visible    = false;
                    this.dataGridView1.Columns["bas_acc_bank2"].Visible  = false;
                    this.dataGridView1.Columns["bas_acc_name2"].Visible  = false;
                    this.dataGridView1.Columns["bas_acc_no2"].Visible    = false;
                    this.dataGridView1.Columns["bas_cont"].Visible       = false;
                    this.dataGridView1.Columns["bas_intern"].Visible     = false;
                    this.dataGridView1.Columns["bas_intern_no"].Visible  = false;
                    this.dataGridView1.Columns["bas_emp_sdate"].Visible  = false;
                    this.dataGridView1.Columns["bas_emp_edate"].Visible  = false;
                    this.dataGridView1.Columns["bas_entdate"].HeaderText = "입사일자";
                    this.dataGridView1.Columns["bas_resdate"].Visible    = false;
                    this.dataGridView1.Columns["bas_levdate"].Visible    = false;
                    this.dataGridView1.Columns["bas_reidate"].Visible    = false;
                    this.dataGridView1.Columns["bas_wsta"].Visible       = false;
                    this.dataGridView1.Columns["bas_sts"].Visible        = false;
                    this.dataGridView1.Columns["bas_pos"].Visible        = false;
                    this.dataGridView1.Columns["bas_dut"].HeaderText     = "직위";
                    this.dataGridView1.Columns["bas_dept"].HeaderText    = "부서";
                    this.dataGridView1.Columns["bas_rmk"].Visible        = false;
                    this.dataGridView1.Columns["bas_pos_dt"].Visible     = false;
                    this.dataGridView1.Columns["bas_dut_dt"].Visible     = false;
                    this.dataGridView1.Columns["bas_dept_dt"].Visible    = false;
                    this.dataGridView1.Columns["bas_intern_dt"].Visible  = false;
                    #endregion
                }
            }
        }