Пример #1
0
 public void Create(ThoiKhoaBieu tkb)
 {
     using (var context = new QuanLyDaoTaoEntities())
     {
         context.ThoiKhoaBieux.Add(tkb);
         context.SaveChanges();
     }
 }
Пример #2
0
 public void Delete(ThoiKhoaBieu tkb)
 {
     using (var context = new QuanLyDaoTaoEntities())
     {
         ThoiKhoaBieu thoiKhoaBieu = context.ThoiKhoaBieux.Where(x => x.Ngay == tkb.Ngay && x.Buoi == tkb.Buoi && x.MaLopTC == tkb.MaLopTC).FirstOrDefault();
         context.ThoiKhoaBieux.Remove(thoiKhoaBieu);
         context.SaveChanges();
     }
 }
Пример #3
0
 public void Edit(ThoiKhoaBieu tkb)
 {
     using (var context = new QuanLyDaoTaoEntities())
     {
         var query = context.ThoiKhoaBieux.Where(x => x.Ngay == tkb.Ngay && x.Buoi == tkb.Buoi && x.MaLopTC == tkb.MaLopTC).FirstOrDefault();
         context.Entry(query).CurrentValues.SetValues(tkb);
         context.SaveChanges();
     }
 }