public ActionResult getDanhsachMonHoc() { MonHocService mh = new MonHocService(); var list = mh.GetAll(); return(View(list)); }
public ActionResult LopHocPhan() { MonHocService mh = new MonHocService(); var list = mh.GetAll(); return(View(list)); }
public ActionResult DangKyHocPhan() { List <MonHoc> list = new List <MonHoc>(); MonHocService mh = new MonHocService(); KetQuaHocTapService ketQuaHocTap = new KetQuaHocTapService(); LopHocPhanService lopHocPhanService = new LopHocPhanService(); QLSVDatabaseContext db = new QLSVDatabaseContext(); List <KetQuaHocTap> a = db.KetQuaHocTaps.Where(x => x.SinhVienId == 2).ToList(); if (a.Count == 0) { return(PartialView(mh.GetAll())); } foreach (var item in a) { foreach (var y in mh.GetAll()) { if (y.MonhocId != lopHocPhanService.getById(item.LopHocPhanId).MonHocId) { var DataMonHoc = new MonHoc(); DataMonHoc = y; list.Add(DataMonHoc); } } } return(PartialView(list)); }
public frmBoSungDiem(string IDStudent, string IDKhoa) { InitializeComponent(); this.IDStudent = IDStudent; var lsMonHoc = MonHocService.GetListMonHocByIDKhoa(IDKhoa); foreach (MonHoc mon in lsMonHoc) { Label label = new Label(); label.Text = mon.TenMonHoc; TextBox text = new TextBox(); text.Text = "0"; text.Name = mon.IDMonHoc; lsTextBox.Add(text); flpBoSungDiem.Controls.Add(label); flpBoSungDiem.Controls.Add(text); } var lsDiem = DiemService.GetListDiemByIDStudent(IDStudent); foreach (TextBox tb in lsTextBox) { foreach (Diem diem in lsDiem) { if (tb.Name == diem.IDMonHoc) { tb.Text = diem.DiemMonHoc.ToString(); } } } }
public GiangVienController() { serMH = new MonHocService(); serLHP = new LopHocPhanService(); serSV = new SinhVienService(); serkqht = new KetQuaHocTapService(); db = new QLSVDatabaseContext(); }
public void TestLayDanhSachMonHoc() { IMonHocService ims = new MonHocService(); string error = ""; var result = ims.LayDanhSachMonHoc(ref error); Assert.AreEqual(result.Count, 0, "Lỗi: TestLayDanhSachMonHoc: không trả về kết quả."); }
private void loadCheckedListbox() { clbSinhVien.Items.Clear(); List <Student> lsstudent = StudentService.GetAllStudentDB(null); clbSinhVien.DisplayMember = "FullName"; foreach (Student std in lsstudent) { clbSinhVien.Items.Add(std); } clbSinhVien.SelectedIndex = 0; var lsVan = MonHocService.GetListMonHocByIDKhoa("1"); var lsMonHoc = MonHocService.GetListMonHoc(); foreach (MonHoc mon in lsMonHoc) { Label label = new Label(); label.Text = mon.TenMonHoc; TextBox text = new TextBox(); text.Text = "0"; text.Name = mon.IDMonHoc; lsTextBox.Add(text); if (mon.IDKhoa == Van) { flpVan.Controls.Add(label); flpVan.Controls.Add(text); } else if (mon.IDKhoa == VatLy) { flpVatLy.Controls.Add(label); flpVatLy.Controls.Add(text); } else if (mon.IDKhoa == CNTT) { flpCNTT.Controls.Add(label); flpCNTT.Controls.Add(text); } } Student stdent = clbSinhVien.Items[0] as Student; var lsDiem = DiemService.GetListDiemByIDStudent(stdent.IDStudent); foreach (TextBox tb in lsTextBox) { foreach (Diem diem in lsDiem) { if (tb.Name == diem.IDMonHoc) { tb.Text = diem.DiemMonHoc.ToString(); } } } }
public Form1() { InitializeComponent(); LoadLop(); var list = MonHocService.getMonHoc(); foreach (MonHoc mon in list) { cbMH.Items.Add(mon); } }
public ActionResult DanhSachMonHoc() { List <MonHoc> list = new List <MonHoc>(); MonHocService mh = new MonHocService(); foreach (var item in mh.GetAll()) { var DataMonHoc = new MonHoc(); DataMonHoc = item; list.Add(DataMonHoc); } return(PartialView(list)); }
public ActionResult getDangKy(int idlhp) { List <DKHP> list_dkhp = new List <DKHP>(); LopHocPhanService ser_lhp = new LopHocPhanService(); List <LopHocPhan> list_lhp = new List <LopHocPhan>(); LopHocPhan lhp = ser_lhp.getById(idlhp); List <KetQuaHocTap> list_kqht = new List <KetQuaHocTap>(); KetQuaHocTapService kqhtsv = new KetQuaHocTapService(); KetQuaHocTap kq = new KetQuaHocTap(); kq.LopHocPhanId = idlhp; kq.SinhVienId = User.Identity.GetUserName(); kq = kqhtsv.Add(kq); MonHocService ser_mh = new MonHocService(); int idmon = lhp.MonHocId; MonHoc mh = ser_mh.getById(idmon); DKHP dkhp = new DKHP(); dkhp.idkqht = kq.kqhtID; dkhp.malhp = kq.LopHocPhanId; dkhp.idsv = kq.SinhVienId; dkhp.malhp = idlhp; dkhp.tenmh = mh.TenMonHoc; dkhp.sotc = mh.Sotinchi; // dkhp.ngaydk = DateTime.Today; if (lhp.TrangThai == EnumsHelper.TrangThaiLHP.Cho_SV_dang_ki) { dkhp.trangthai = "Chờ sinh viên đăng kí"; } else if (lhp.TrangThai == EnumsHelper.TrangThaiLHP.Chap_Nhan_Mo_Lop) { dkhp.trangthai = "Chấp nhận mở lớp"; } else { dkhp.trangthai = "Chờ hủy lớp"; } list_dkhp.Add(dkhp); return(Json(dkhp, JsonRequestBehavior.AllowGet)); }
public JsonResult ChanSauDangKy(int idlhp) { LopHocPhanService ser_lhp = new LopHocPhanService(); MonHocService ser_mh = new MonHocService(); //load lai mon hoc LopHocPhan lhp = ser_lhp.getById(idlhp); MonHoc mh = ser_mh.getById(lhp.MonHocId); List <MonHoc> list_mh = ser_mh.GetAll().ToList(); for (int i = 0; i < list_mh.Count; i++) { if (list_mh[i].MonhocId == mh.MonhocId) { list_mh.RemoveAt(i); } } return(Json(list_mh, JsonRequestBehavior.AllowGet)); }
public HttpResponseMessage XemDanhSachMonHoc() { HttpResponseMessage respMsg; string errorMsg = ""; IMonHocService ims = new MonHocService(); var lst = ims.LayDanhSachMonHoc(ref errorMsg); if (errorMsg != "") { respMsg = Request.CreateResponse(HttpStatusCode.InternalServerError, JsonConvert.SerializeObject(new { msg = errorMsg, lst })); } else { respMsg = Request.CreateResponse(HttpStatusCode.OK, JsonConvert.SerializeObject(new { lst })); } return(respMsg); }
public QuanLyController() { serlhp = new LopHocPhanService(); sermh = new MonHocService(); }
public ActionResult DangKyHocPhan() { string idsv = User.Identity.GetUserName(); Model_DangKyHocPhan a = new Model_DangKyHocPhan(); List <MonHoc> monHocs = new List <MonHoc>(); SinhVienService sinhVienService = new SinhVienService(); MonHocService mh = new MonHocService(); List <MonHoc> monhocs = db.MonHocs.Select(x => x).ToList(); List <KetQuaHocTap> kqht = db.KetQuaHocTaps.Where(x => x.SinhVienId.Equals(idsv)).ToList(); List <LopHocPhan> lhp = db.LopHocPhans.Select(x => x).ToList(); List <LopHocPhan> listtemp = new List <LopHocPhan>(); MonHocService ser_mh = new MonHocService(); List <MonHoc> list_mh = ser_mh.GetAll().ToList(); foreach (var item in kqht) { LopHocPhan lhpnew = new LopHocPhan(); lhpnew = db.LopHocPhans.Where(x => x.LopHocPhanId == item.LopHocPhanId).FirstOrDefault() ; int malop = lhpnew.MonHocId; for (int i = 0; i < list_mh.Count; i++) { if (list_mh[i].MonhocId == malop) { list_mh.RemoveAt(i); } } } //for (int i = 0; i < kqht.Count; i++) //{ // for (int j = 0; j < lhp.Count; j++) // { // if (kqht[i].LopHocPhanId == lhp[j].LopHocPhanId) // { // LopHocPhan temp = new LopHocPhan(); // temp = lhp[j]; // listtemp.Add(temp); // } // } //} //for (int i = 0; i < mon; i++) //{ // for (int j = 0; j < listtemp.Count; j++) // { // if (item.MonhocId != listtemp[i].MonHocId) // { // monHocs.Add(item); // } // } //} //foreach (var item in mh.GetAll()) //{ // var monhoc = new MonHoc(); // monhoc = item; // monHocs.Add(monhoc); //} //hoc ki List <HocKy> hockis = new List <HocKy>(); HocKyService hk = new HocKyService(); foreach (var item in hk.GetAll()) { var hocky = new HocKy(); hocky = item; hockis.Add(hocky); } //sinh vien SinhVien sv = new SinhVien(); sv = db.SinhViens.Where(x => x.SinhVienId.Equals(idsv)).FirstOrDefault(); a.mHocKy = hockis; //a.mMonHoc = monHocs; a.mMonHoc = list_mh; a.mSinhVien = sv; return(PartialView(a)); }