public void XoaSV(User user)
        {
            var ur  = db.Users.Find(user.MaSV);
            var SV  = db.SinhViens.Find(user.MaSV);
            var DRL = db.DiemRenLuyens.Where(x => x.MaSV == user.MaSV).ToList();

            if (ur != null && SV != null && DRL != null)
            {
                ur.xoa = 1;
                SV.xoa = 1;
                foreach (var item in DRL)
                {
                    item.Xoa = 1;
                }
                db.SaveChanges();
            }
        }
 public void create(double MaSV, int Id_NamHoc, int Id_HocKi)
 {
     if (GetByRL(MaSV, Id_NamHoc, Id_HocKi) == null)
     {
         DiemRenLuyen diemLop = new DiemRenLuyen();
         diemLop.MaSV      = MaSV;
         diemLop.Id_NamHoc = Id_NamHoc;
         diemLop.Id_HocKi  = Id_HocKi;
         diemLop.Muc1_1    = 0;
         diemLop.Muc1_2    = 0;
         diemLop.Muc1_3    = 0;
         diemLop.Muc1_4    = 0;
         diemLop.Muc2_1    = 0;
         diemLop.Muc2_2    = 0;
         diemLop.Muc2_3    = 0;
         diemLop.Muc3_1    = 0;
         diemLop.Muc3_2    = 0;
         diemLop.Muc4_1    = 0;
         diemLop.Muc4_2    = 0;
         diemLop.Muc4_3    = 0;
         diemLop.Muc5_1    = 0;
         diemLop.Muc5_2    = 0;
         diemLop.Muc5_3    = 0;
         diemLop.Muc6_1    = 0;
         diemLop.TongMuc1  = 0;
         diemLop.TongMuc2  = 0;
         diemLop.TongMuc3  = 0;
         diemLop.TongMuc4  = 0;
         diemLop.TongMuc5  = 0;
         diemLop.Xoa       = 0;
         db.DiemRenLuyens.Add(diemLop);
         db.SaveChanges();
     }
     else
     {
         return;
     }
 }
 public void Insert(User entity)
 {
     db.Users.Add(entity);
     db.SaveChanges();
 }