public List <LopHoc> getListLopHocChiTiet(int maKH) { using (var db = new TTTA_DBEntities()) { return(db.LopHocs.Where(x => x.KhoaHoc == maKH).ToList()); } }
public List <BienLaiHocPhi> getListBienLai(int maKH) { using (var db = new TTTA_DBEntities()) { return(db.BienLaiHocPhis.Where(x => x.MaKhoaHoc == maKH).ToList()); } }
public MonHoc getMonHoc(int maMH) { using (var db = new TTTA_DBEntities()) { return(db.MonHocs.SingleOrDefault(x => x.MaMH == maMH)); } }
public List <LopHoc> getListLopHocByMaKH_MaGV(int maKH, int maGV) { using (var db = new TTTA_DBEntities()) { return(db.LopHocs.Where(x => x.KhoaHoc == maKH && x.GiangVien == maGV).ToList()); } }
public DangNhap getTaiKhoan(string mail) { using (var db = new TTTA_DBEntities()) { return(db.DangNhaps.SingleOrDefault(x => x.Mail == mail)); } }
public KhoaHoc getKhoaHoc(int maKH) { using (var db = new TTTA_DBEntities()) { return(db.KhoaHocs.SingleOrDefault(x => x.MaKH == maKH)); } }
public GiangVien getGiangVien(string mail) { using (var db = new TTTA_DBEntities()) { return(db.GiangViens.SingleOrDefault(x => x.Mail == mail)); } }
public List <KhoaHoc> getListKhoaHoc() { using (var db = new TTTA_DBEntities()) { return(db.KhoaHocs.ToList()); } }
public List <KhoaHoc> getListKhoaHocChuaHoanThanh() { using (var db = new TTTA_DBEntities()) { return(db.KhoaHocs.Where(x => x.TinhTrang.Equals("Chua hoan thanh")).ToList()); } }
public List <HocVien> getListHocVien() { using (var db = new TTTA_DBEntities()) { return(db.HocViens.ToList()); } }
public DangNhap xacThuc(string mail, string matKhau, string quyenDangNhap) { using (var db = new TTTA_DBEntities()) { return(db.DangNhaps.Where(x => x.Mail == mail && x.MatKhau == matKhau && x.QuyenDangNhap == quyenDangNhap).FirstOrDefault()); } }
public HocVien getHocVien(int maHV) { using (var db = new TTTA_DBEntities()) { return(db.HocViens.SingleOrDefault(x => x.MaHV == maHV)); } }
public List <DangNhap> getListTaiKhoanGV() { using (var db = new TTTA_DBEntities()) { return(db.DangNhaps.Where(x => x.QuyenDangNhap == "giangvien").ToList()); } }
public List <DangNhap> getListTaiKhoanGVChuaDK() { //List<GiangVien> listGiangVien = GiangVienBUS.Instance.getLisGiangVien(); //for (int i = 0; i < listTaiKhoan.Count; i++) //{ // bool flag = true; // for (int j = 0; j < listGiangVien.Count; j++) // { // if (listTaiKhoan[i].Mail == listGiangVien[j].Mail) // { // flag = false; // break; // } // } // if (flag) // { // listTaiKhoancChuaDK.Add(listTaiKhoan[i]); // } //} using (var db = new TTTA_DBEntities()) { List <DangNhap> listTaiKhoanDaDK = new List <DangNhap>(); db.GiangViens.Include("DangNhap").ToList().ForEach(x => listTaiKhoanDaDK.Add(x.DangNhap)); db.NhanViens.Include("DangNhap").ToList().ForEach(x => listTaiKhoanDaDK.Add(x.DangNhap)); return(db.DangNhaps.ToList().Except(listTaiKhoanDaDK).ToList()); } }
public LopHoc getLopHoc(int maLH) { using (var db = new TTTA_DBEntities()) { return(db.LopHocs.SingleOrDefault(x => x.MaLH == maLH)); } }
public List <LopHoc> getListLopHoc() { using (var db = new TTTA_DBEntities()) { return(db.LopHocs.ToList()); } }
public List <KetQua> getListKetQua(int makh, int malh) { using (var db = new TTTA_DBEntities()) { return(db.KetQuas.Include("HocVien").Where(x => x.MaKhoaHoc == makh && x.MaLopHoc == malh).ToList()); } }
public List <DangNhap> getListTaiKhoan() { using (var db = new TTTA_DBEntities()) { return(db.DangNhaps.ToList()); } }
public GiangVien getGiangVien(int maGV) { using (var db = new TTTA_DBEntities()) { return(db.GiangViens.SingleOrDefault(x => x.MaGV == maGV)); } }
public List <GiangVien> getLisGiangVien() { using (var db = new TTTA_DBEntities()) { return(db.GiangViens.ToList()); } }
public List <LopHoc> getListLopHocDaDK(int maHV, int maKH) { using (var db = new TTTA_DBEntities()) { List <LopHoc> listDaDK = new List <LopHoc>(); db.BienLaiHocPhis.Include("LopHoc").Where(x => x.MaKhoaHoc == maKH && x.MaHocVien == maHV).ToList().ForEach(x => listDaDK.Add(x.LopHoc)); return(listDaDK); } }
public List <HocVien> getListHocVien(int maKH, int maLH) { List <HocVien> listHV = new List <HocVien>(); using (var db = new TTTA_DBEntities()) { db.BienLaiHocPhis.Include("HocVien").Where(x => x.MaKhoaHoc == maKH && x.MaLopHoc == maLH).ToList().ForEach(x => listHV.Add(x.HocVien)); } return(listHV); }
public KetQua getKetQua(int maHV, int maLH, int maKH) { using (var db = new TTTA_DBEntities()) { return(db.KetQuas.SingleOrDefault( x => x.MaHocVien == maHV && x.MaLopHoc == maLH && x.MaKhoaHoc == maKH)); } }
public bool xoaMonHoc(int maMH) { MonHoc monHoc = new MonHoc() { MaMH = maMH }; using (var db = new TTTA_DBEntities()) { db.Entry(monHoc).State = System.Data.Entity.EntityState.Deleted; return(db.SaveChanges() > 0); } }
public bool xoaHocVien(int maHV) { HocVien hocVien = new HocVien() { MaHV = maHV }; using (var db = new TTTA_DBEntities()) { db.Entry(hocVien).State = System.Data.Entity.EntityState.Deleted; return(db.SaveChanges() > 0); } }
public bool xoaKhoaHoc(int maKH) { KhoaHoc khoaHoc = new KhoaHoc() { MaKH = maKH }; using (var db = new TTTA_DBEntities()) { db.Entry(khoaHoc).State = System.Data.Entity.EntityState.Deleted; return(db.SaveChanges() > 0); } }
public bool doiMatKhau(DangNhap taiKhoan, string matKhauMoi) { using (var db = new TTTA_DBEntities()) { var result = db.DangNhaps.SingleOrDefault(x => x.Mail == taiKhoan.Mail); if (result != null) { result.MatKhau = matKhauMoi; db.SaveChanges(); } return(false); } }
public bool xoaGiangVien(int maGV) { GiangVien giangVien = new GiangVien() { MaGV = maGV }; using (var db = new TTTA_DBEntities()) { db.Entry(giangVien).State = System.Data.Entity.EntityState.Deleted; return(db.SaveChanges() > 0); } }
public int tinhDiemTB(int maLH, int maKH) { using (var db = new TTTA_DBEntities()) { db.KetQuas.Where(x => x.MaKhoaHoc == maKH && x.MaLopHoc == maLH).ToList(). ForEach(x => { x.DiemTB = (x.DiemCuoiKy + x.DiemGiuaKy) / 2; db.Entry(x).State = System.Data.Entity.EntityState.Modified; }); return(db.SaveChanges()); } }
public bool xoaTaiKhoan(string mail) { DangNhap dangnhap = new DangNhap() { Mail = mail, }; using (var db = new TTTA_DBEntities()) { db.DangNhaps.Attach(dangnhap); db.DangNhaps.Remove(dangnhap); return(db.SaveChanges() > 0); } }