public List <HocSinh_DTO> LayHocSinhTheoLop(int id) { List <HocSinh_DTO> DSHS = new List <HocSinh_DTO>(); DataTable data = DataProvider.Instance.ExecuteQuery("select hocsinh.*,TenLop from hocsinh join lop on HocSinh.MaLop = Lop.MaLop where HocSinh.MaLop = " + id); foreach (DataRow item in data.Rows) { HocSinh_DTO hs = new HocSinh_DTO(item); DSHS.Add(hs); } return(DSHS); }
public List <HocSinh_DTO> TimKiemHS(string param) { List <HocSinh_DTO> DSHS = new List <HocSinh_DTO>(); string query = string.Format("select hocsinh.*,TenLop from hocsinh join lop on HocSinh.MaLop = Lop.MaLop where TenHocSinh like N'%{0}%'", param); DataTable data = DataProvider.Instance.ExecuteQuery(query); foreach (DataRow item in data.Rows) { HocSinh_DTO hs = new HocSinh_DTO(item); DSHS.Add(hs); } return(DSHS); }