public void timkiem(TIMNHANVIEN f) { if (f.rdb_theoma.Checked) { string sql = "SELECT * FROM NhanVien WHERE IsDelete = 1 AND MaNV LIKE '%" + f.txt_manv.Text + "%'"; SqlCommand cmd = new SqlCommand(sql, con); SqlDataReader dr = cmd.ExecuteReader(); DataTable dt = new DataTable(); dt.Load(dr); f.dgv_nhanvien.DataSource = dt; } else if (f.rdb_theoten.Checked) { string sql = "SELECT * FROM NhanVien WHERE IsDelete = 1 AND TenNV LIKE'%" + f.txt_manv.Text + "%'"; SqlCommand cmd = new SqlCommand(sql, con); SqlDataReader dr = cmd.ExecuteReader(); DataTable dt = new DataTable(); dt.Load(dr); f.dgv_nhanvien.DataSource = dt; } else { MessageBox.Show("Chọn phương thức tìm kiếm!", "Thông Báo"); return; } }
public void loaddulieu(TIMNHANVIEN f) { string sql = "SELECT * FROM NhanVien WHERE IsDelete = 1"; SqlCommand cmd = new SqlCommand(sql, con); SqlDataReader dr = cmd.ExecuteReader(); DataTable dt = new DataTable(); dt.Load(dr); f.dgv_nhanvien.DataSource = dt; }
private void button1_Click(object sender, EventArgs e) { TIMNHANVIEN TNV = new TIMNHANVIEN(); TNV.Show(); }