public JsonResult getDangKyHocPhan(int id) { LopHocPhanService lopHocPhan = new LopHocPhanService(); KetQuaHocTapService kqhtsev = new KetQuaHocTapService(); List <LopHocPhan> lopHocPhans = lopHocPhan.GetLopHocPhansByID(id).ToList(); List <LopHocPhan_soluong> lsl = new List <LopHocPhan_soluong>(); foreach (var item in lopHocPhans) { LopHocPhan_soluong x = new LopHocPhan_soluong(); x.malophp = item.LopHocPhanId; x.sisotoida = item.soLuongSV; x.tenlophp = item.tenLopHocPhan; if (item.TrangThai == EnumsHelper.TrangThaiLHP.Cho_SV_dang_ki) { x.trangthai = "Chờ sinh viên đăng kí"; } else if (item.TrangThai == EnumsHelper.TrangThaiLHP.Chap_Nhan_Mo_Lop) { x.trangthai = "Chấp nhận mở lớp"; } else { x.trangthai = "Chờ hủy lớp"; } x.sisohientai = kqhtsev.getSLSVDK(item.LopHocPhanId); lsl.Add(x); } var res = Json(lsl, JsonRequestBehavior.AllowGet); return(res); }
public JsonResult getDanhSachLopHocPhan_Hocky(int idmh, int idhk)// { LopHocPhanService sc = new LopHocPhanService(); IEnumerable <LopHocPhan> lst = new List <LopHocPhan>(); lst = sc.GetLopHocPhan_by_idMh_idHk(idmh, idhk); KetQuaHocTapService kqhtsev = new KetQuaHocTapService(); List <LopHocPhan_soluong> lsl = new List <LopHocPhan_soluong>(); foreach (var item in lst) { LopHocPhan_soluong x = new LopHocPhan_soluong(); x.malophp = item.LopHocPhanId; x.sisotoida = item.soLuongSV; x.tenlophp = item.tenLopHocPhan; if (item.TrangThai.Equals("1")) { x.trangthai = "Chờ sinh viên đăng kí"; } else { if (item.TrangThai.Equals("2")) { x.trangthai = "Chấp nhận mở lớp"; } else { x.trangthai = "Chờ hủy lớp"; } } x.sisohientai = kqhtsev.getSLSVDK(item.LopHocPhanId); lsl.Add(x); } return(Json(lsl, JsonRequestBehavior.AllowGet)); }