public static List <DiemMon> getDiemMon(int namhoc, int hocky) { List <DiemMon> listct = new List <DiemMon>(); string query = "select * from DiemMon where NamHoc=" + namhoc + " and HocKy=" + hocky; DataTable db = DataProvider.LoadData(query); for (int i = 0; i < db.Rows.Count; i++) { DiemMon dm = new DiemMon(); dm.Hocky = hocky; dm.NamHoc = namhoc; dm.DiemKT = db.Rows[i]["DiemKT"].ToString(); dm.DiemThi = db.Rows[i]["DiemThi"].ToString(); dm.DiemTK10 = db.Rows[i]["DiemTK10"].ToString(); dm.DiemChu = db.Rows[i]["DiemChu"].ToString(); dm.MonHoc.MaMH = db.Rows[i]["MaMH"].ToString(); listct.Add(dm); } foreach (DiemMon dm in listct) { dm.MonHoc = BMonHoc.getByMaMH(dm.MonHoc.MaMH); } return(listct); }
public static List <LichHoc> getAll() { string query = "select * from LichHoc"; list = new List <LichHoc>(); DataTable db = DataProvider.LoadData(query); for (int i = 0; i < db.Rows.Count; i++) { LichHoc mh = new LichHoc(); mh.Id = db.Rows[i]["Id"].ToString(); mh.MaLop = db.Rows[i]["MaLop"].ToString(); mh.ThoigianBD = db.Rows[i]["ThoigianBD"].ToString(); mh.ThoigianKT = db.Rows[i]["ThoigianKT"].ToString(); mh.NhomMH = db.Rows[i]["NhomMH"].ToString(); mh.MonHoc = new MonHoc(); mh.MonHoc.MaMH = db.Rows[i]["MaMH"].ToString(); list.Add(mh); } foreach (LichHoc lh in list) { lh.Chitiet = getChiTiets(lh.Id); lh.MonHoc = BMonHoc.getByMaMH(lh.MonHoc.MaMH); } return(list); }
public static List <LichThi> getAll() { list = new List <LichThi>(); string query = "select * from LichThi"; DataTable db = DataProvider.LoadData(query); for (int i = 0; i < db.Rows.Count; i++) { LichThi lt = new LichThi(); lt.MonHoc = new MonHoc(); lt.MonHoc.MaMH = db.Rows[i]["MaMH"].ToString(); lt.GhepThi = db.Rows[i]["GhepThi"].ToString(); lt.ToThi = db.Rows[i]["ToThi"].ToString(); lt.SoLuong = int.Parse(db.Rows[i]["SoLuong"].ToString()); lt.NgayThi = db.Rows[i]["NgayThi"].ToString(); lt.GioBD = db.Rows[i]["GioBD"].ToString(); lt.SoPhut = int.Parse(db.Rows[i]["SoPhut"].ToString()); lt.PhongThi = db.Rows[i]["PhongThi"].ToString(); list.Add(lt); } foreach (LichThi lt in list) { lt.MonHoc = BMonHoc.getByMaMH(lt.MonHoc.MaMH); } return(list); }
public static List <CTHocPhi> getCTHP(int NamHoc, int HocKy) { string query = string.Format("select * from CTHocPhi where NamHoc={0} and HocKy={1}", NamHoc, HocKy); List <CTHocPhi> listct = new List <CTHocPhi>(); DataTable db = DataProvider.LoadData(query); for (int i = 0; i < db.Rows.Count; i++) { CTHocPhi ct = new CTHocPhi(); ct.monHoc = BMonHoc.getByMaMH(db.Rows[i]["MaMH"].ToString()); ct.HocPhi = db.Rows[i]["HocPhi"].ToString(); ct.MienGiam = db.Rows[i]["MienGiam"].ToString(); ct.MaNhom = db.Rows[i]["MaNhom"].ToString(); ct.PhaiDong = db.Rows[i]["PhaiDong"].ToString(); ct.NamHoc = int.Parse(db.Rows[i]["NamHoc"].ToString()); ct.HocKy = int.Parse(db.Rows[i]["HocKy"].ToString()); listct.Add(ct); } return(listct); }