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 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 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 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 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); } }
public bool themMonHoc(int maMH, string tenMH, int soGioHoc) { MonHoc monHoc = new MonHoc() { MaMH = maMH, TenMH = tenMH, SoGioHoc = soGioHoc }; using (var db = new TTTA_DBEntities()) { db.MonHocs.Add(monHoc); return(db.SaveChanges() > 0); } }
public bool themTaiKhoan(string mail, string matKhau, string quyenDangNhap) { DangNhap dangnhap = new DangNhap() { Mail = mail, MatKhau = matKhau, QuyenDangNhap = quyenDangNhap }; using (var db = new TTTA_DBEntities()) { db.DangNhaps.Add(dangnhap); 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 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 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 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 themKhoaHoc(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.KhoaHocs.Add(khoaHoc); return(db.SaveChanges() > 0); } }
public bool themBienLai(int maHV, int maLH, int maKH, string hoaDon) { BienLaiHocPhi bienLai = new BienLaiHocPhi() { MaHocVien = maHV, MaLopHoc = maLH, MaKhoaHoc = maKH, HoaDon = hoaDon }; using (var db = new TTTA_DBEntities()) { db.BienLaiHocPhis.Add(bienLai); //db.Entry(bienLai).State = System.Data.Entity.EntityState.Added; 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 themKetQua(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.KetQuas.Add(ketQua); return(db.SaveChanges() > 0); } }
public bool themHocVien(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.HocViens.Add(hocVien); 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 themGiangVien(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.GiangViens.Add(giangVien); return(db.SaveChanges() > 0); } }
public bool themLopHoc(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.LopHocs.Add(lopHoc); 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); } }