private void button1_Click_1(object sender, EventArgs e) { if (cb_SelectBox.SelectedIndex == -1) { } else { String value = cb_SelectBox.SelectedItem.ToString(); string result = ""; switch (value) { case "번호": result = "type"; break; case "구분": result = "type"; break; case "장비명": result = "type"; break; case "관리자(정)": result = "type"; break; case "관리자(부)": result = "type"; break; case "브랜드명": result = "type"; break; case "구입일자": result = "type"; break; case "IP": result = "type"; break; case "사용유무": result = "type"; break; } dataGridView1.Rows.Clear(); List <Machine> machines = new List <Machine>(); machines = _SI.FindDataMachine(result, tb_SelectData.Text); if (machines is null) { ; } else { foreach (Machine machine in machines) { dataGridView1.Rows.Add(machine.No, machine.Name, machine.Supervisor, machine.Subordinate, machine.Manufact, machine.Buy, machine.IP, machine.Use); } btn_Delete_Apply.Visible = false; lbl_DataSelect.Text = "Data Select"; _SelectedData.No = (int)dataGridView1.Rows[0].Cells[0].Value; _SelectedData.Name = dataGridView1.Rows[0].Cells[1].Value.ToString(); _SelectedData.Division = dataGridView1.Rows[0].Cells[2].Value.ToString(); _SelectedData.Supervisor = dataGridView1.Rows[0].Cells[3].Value.ToString(); _SelectedData.Subordinate = dataGridView1.Rows[0].Cells[4].Value.ToString(); _SelectedData.Manufact = dataGridView1.Rows[0].Cells[5].Value.ToString(); _SelectedData.Buy = dataGridView1.Rows[0].Cells[6].Value.ToString(); _SelectedData.IP = dataGridView1.Rows[0].Cells[7].Value.ToString(); _SelectedData.Use = dataGridView1.Rows[0].Cells[8].Value.ToString(); SetSelectData(); SetSelectPanel(pnl_Select); } } }