コード例 #1
0
        public static void XoaDiemSVVan(string idSinhVien)
        {
            var db           = new MyApplicationContext();
            var itemToRemove = db.KhoaVanDbSet.SingleOrDefault(x => x.IDSinhVien.Equals(idSinhVien));

            if (itemToRemove != null)
            {
                db.KhoaVanDbSet.Remove(itemToRemove);
                db.SaveChanges();
            }
        }
コード例 #2
0
        public static void CapNhatDiemSVCNTT(float DiemC, float DiemJava, string IDSinhvien)
        {
            var db     = new MyApplicationContext();
            var result = db.KhoaTinDbSet.SingleOrDefault(a => a.IDSinhVien.Equals(IDSinhvien));

            if (result != null)
            {
                result.DiemC    = DiemC;
                result.DiemJava = DiemJava;
                db.SaveChanges();
            }
        }
コード例 #3
0
        public static void ThemDiemSVVan(float DiemVHCD, float DiemVHHD, string IDSinhvien)
        {
            var db  = new MyApplicationContext();
            var cre = db.KhoaVanDbSet.Create();

            cre.IDDiem     = Guid.NewGuid().ToString();
            cre.DiemVHCD   = DiemVHCD;
            cre.DiemVHHD   = DiemVHHD;
            cre.IDSinhVien = IDSinhvien;
            db.KhoaVanDbSet.Add(cre);
            db.SaveChanges();
        }
コード例 #4
0
        public static void ThemDiemSVLy(float DiemCoHoc, float DiemQuangHoc, string IDSinhvien)
        {
            var db  = new MyApplicationContext();
            var cre = db.KhoaLyDbSet.Create();

            cre.IDDiem       = Guid.NewGuid().ToString();
            cre.DiemCoHoc    = DiemCoHoc;
            cre.DiemQuangHoc = DiemQuangHoc;
            cre.IDSinhVien   = IDSinhvien;
            db.KhoaLyDbSet.Add(cre);
            db.SaveChanges();
        }
コード例 #5
0
        public static void ThemDiemSVCNTT(float DiemC, float DiemJava, string IDSinhvien)
        {
            var db  = new MyApplicationContext();
            var cre = db.KhoaTinDbSet.Create();

            cre.IDDiem     = Guid.NewGuid().ToString();
            cre.DiemC      = DiemC;
            cre.DiemJava   = DiemJava;
            cre.IDSinhVien = IDSinhvien;
            db.KhoaTinDbSet.Add(cre);
            db.SaveChanges();
        }
コード例 #6
0
        public static void CapNhatDiemSVVan(float DiemVHCD, float DiemVHHD, string IDSinhvien)
        {
            var db     = new MyApplicationContext();
            var result = db.KhoaVanDbSet.SingleOrDefault(a => a.IDSinhVien.Equals(IDSinhvien));

            if (result != null)
            {
                result.DiemVHCD = DiemVHCD;
                result.DiemVHHD = DiemVHHD;
                db.SaveChanges();
            }
        }
コード例 #7
0
        public static void CapNhatDiemSVLy(float DiemCo, float DiemQuang, string IDSinhvien)
        {
            var db     = new MyApplicationContext();
            var result = db.KhoaLyDbSet.SingleOrDefault(a => a.IDSinhVien.Equals(IDSinhvien));

            if (result != null)
            {
                result.DiemCoHoc    = DiemCo;
                result.DiemQuangHoc = DiemQuang;
                db.SaveChanges();
            }
        }
コード例 #8
0
        public static void CapNhatThongTinSV(string IDSinhVien, string HoTen, int GioiTinh, DateTime NgaySinh)
        {
            var db     = new MyApplicationContext();
            var result = db.SinhViensDbSet.SingleOrDefault(a => a.IDSinhVien.Equals(IDSinhVien));

            if (result != null)
            {
                result.HoTen    = HoTen;
                result.GioiTinh = GioiTinh;
                result.NgaySinh = NgaySinh;
                db.SaveChanges();
            }
        }
コード例 #9
0
        public static void ThemSinhVien(string IDSinhVien, string HoTen, int GioiTinh, DateTime NgaySinh, string IDKhoa)
        {
            var db  = new MyApplicationContext();
            var cre = db.SinhViensDbSet.Create();

            cre.IDSinhVien = IDSinhVien;
            cre.HoTen      = HoTen;
            cre.GioiTinh   = GioiTinh;
            cre.NgaySinh   = NgaySinh;
            cre.IDKhoa     = IDKhoa;
            db.SinhViensDbSet.Add(cre);
            db.SaveChanges();
        }