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 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 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 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 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 xoaLopHoc(int maLH, int khoaHoc) { LopHoc lopHoc = new LopHoc() { MaLH = maLH, KhoaHoc = khoaHoc }; using (var db = new TTTA_DBEntities()) { db.Entry(lopHoc).State = System.Data.Entity.EntityState.Deleted; return(db.SaveChanges() > 0); } }
public bool capNhatTaiKhoan(string mail, string matKhau, string quyenDangNhap) { DangNhap dangnhap = new DangNhap() { Mail = mail, MatKhau = matKhau, QuyenDangNhap = quyenDangNhap }; using (var db = new TTTA_DBEntities()) { db.Entry(dangnhap).State = System.Data.Entity.EntityState.Modified; return(db.SaveChanges() > 0); } }
public bool xoaKetQua(int maHV, int maLH, int maKH) { KetQua ketQua = new KetQua() { MaHocVien = maHV, MaLopHoc = maLH, MaKhoaHoc = maKH }; using (var db = new TTTA_DBEntities()) { db.Entry(ketQua).State = System.Data.Entity.EntityState.Deleted; return(db.SaveChanges() > 0); } }
public bool xoaBienLai(int maHV, int maLH, int maKH) { BienLaiHocPhi bienLai = new BienLaiHocPhi() { MaHocVien = maHV, MaLopHoc = maLH, MaKhoaHoc = maKH }; using (var db = new TTTA_DBEntities()) { db.Entry(bienLai).State = System.Data.Entity.EntityState.Deleted; return(db.SaveChanges() > 0); } }
public bool capNhatMonHoc(int maMH, string tenMH, int soGioHoc) { MonHoc monHoc = new MonHoc() { MaMH = maMH, TenMH = tenMH, SoGioHoc = soGioHoc }; using (var db = new TTTA_DBEntities()) { db.Entry(monHoc).State = System.Data.Entity.EntityState.Modified; return(db.SaveChanges() > 0); } }
public bool capNhatKhoaHoc(int maKH, DateTime ngayBatDau, int soTuanHoc, string tinhTrang) { KhoaHoc khoaHoc = new KhoaHoc() { MaKH = maKH, NgayBatDau = ngayBatDau, SoTuanHoc = soTuanHoc, TinhTrang = tinhTrang }; using (var db = new TTTA_DBEntities()) { db.Entry(khoaHoc).State = System.Data.Entity.EntityState.Modified; return(db.SaveChanges() > 0); } }
public bool capNhatKetQua(int maHV, int maLH, int maKH, float?diemGiuaKy, float?diemCuoiKy, float?diemTB) { KetQua ketQua = new KetQua() { MaHocVien = maHV, MaLopHoc = maLH, MaKhoaHoc = maKH, DiemGiuaKy = diemGiuaKy, DiemCuoiKy = diemCuoiKy, DiemTB = diemTB }; using (var db = new TTTA_DBEntities()) { db.Entry(ketQua).State = System.Data.Entity.EntityState.Modified; return(db.SaveChanges() > 0); } }
public bool capNhatHocVien(int maHV, string hoTen, DateTime ngaySinh, string gioiTinh, string diaChi, string soDienThoai) { HocVien hocVien = new HocVien() { MaHV = maHV, HoTen = hoTen, NgaySinh = ngaySinh, GioiTinh = gioiTinh, DiaChi = diaChi, SoDienThoai = soDienThoai }; using (var db = new TTTA_DBEntities()) { db.Entry(hocVien).State = System.Data.Entity.EntityState.Modified; return(db.SaveChanges() > 0); } }
public bool capNhatGiangVien(int maGV, string tenGV, DateTime ngaySinh, int thamNien, string hocVi, int luong, string mail) { GiangVien giangVien = new GiangVien() { MaGV = maGV, TenGV = tenGV, NgaySinh = ngaySinh, ThamNien = thamNien, HocVi = hocVi, Luong = luong, Mail = mail }; using (var db = new TTTA_DBEntities()) { db.Entry(giangVien).State = System.Data.Entity.EntityState.Modified; return(db.SaveChanges() > 0); } }
public bool capNhatLopHoc(int maLH, int khoaHoc, int monHoc, int giangVien, string caHoc, string ngayHoc, string soLuongHV, int soTien) { LopHoc lopHoc = new LopHoc() { MaLH = maLH, KhoaHoc = khoaHoc, MonHoc = monHoc, GiangVien = giangVien, CaHoc = caHoc, NgayHoc = ngayHoc, SoLuongHV = soLuongHV, SoTien = soTien }; using (var db = new TTTA_DBEntities()) { db.Entry(lopHoc).State = System.Data.Entity.EntityState.Modified; return(db.SaveChanges() > 0); } }