private void btnTimKiem_Click(object sender, EventArgs e) { if ((txtHoTen.Text.Trim() != "") || (txtMaSV.Text.Trim() != "")) { dtResult = new DataTable(); pSV_SinhVienInfo.MaSinhVien = txtMaSV.Text.Trim(); pSV_SinhVienInfo.HoVaTen = txtHoTen.Text.Trim(); dtResult = oBSV_SinhVien.TimKiem(pSV_SinhVienInfo); if (dtResult != null) { grdSinhVien.DataSource = dtResult; if (dtResult.Rows.Count > 0) { btnChon.Enabled = true; } else { btnChon.Enabled = false; } } } else { ThongBao("Bạn chưa chọn thông tin tìm kiếm!"); } }
private void dlgLocSinhVien_Load(object sender, EventArgs e) { LoadTreeLop(uctrlLop); uctrlLop.trlLop.FocusedNodeChanged += new DevExpress.XtraTreeList.FocusedNodeChangedEventHandler(trlLop_FocusedNodeChanged); if (MaSinhVien != "") { pSV_SinhVienInfo = new SV_SinhVienInfo(); pSV_SinhVienInfo.MaSinhVien = MaSinhVien; pSV_SinhVienInfo.HoVaTen = ""; dtSinhVien = oBSV_SinhVien.TimKiem(pSV_SinhVienInfo); grdSinhVien.DataSource = dtSinhVien; } }