private void button1_Click(object sender, EventArgs e) { /*tim kiem dua vao loai tim kiem trong combox tim kiem */ string loaitimkiem = comboBox1.Text; //bat dau tim kiem try { switch (loaitimkiem) { case "ID": /*tim kiem thong tin ĐĨA THEO ID*/ int dia_id = int.Parse(txt_search.Text); dataGridView1.DataSource = lg.laydanhsachdiatheoid_GUI_nhanvien_quanlidia(dia_id).ToList(); ancot(); kiemtra_timkiemrong(); break; case "TÊN ĐĨA": //tim kiem thong tin bang ten dia string tendia = txt_search.Text; dataGridView1.DataSource = lg.laydanhsachdiatheotendia_GUI_nhanvien_quanlidia(tendia).ToList(); ancot(); kiemtra_timkiemrong(); break; case "GIÁ": //tim kiem thong tin dua vao gia float gia = float.Parse(txt_search.Text); dataGridView1.DataSource = lg.laydanhsachdiatheogia_GUI_nhanvien_quanlidia(gia).ToList(); ancot(); kiemtra_timkiemrong(); break; } } catch { MessageBox.Show("XEM LẠI THÔNG TIN TÌM KIẾM"); } }