Esempio n. 1
0
 public static void ThemLH(LopHoc lh)
 {
     try {
         var db = new ConnectionsDBContext();
         db.LopHocDbSet.Add(lh);
         db.SaveChanges();
     }
     catch (Exception ex) { }
 }
Esempio n. 2
0
        public static void XoaLH(LopHoc lh)
        {
            var db  = new ConnectionsDBContext();
            var obj = db.LopHocDbSet.Where(e => e.MaLH == lh.MaLH).FirstOrDefault();

            if (obj != null)
            {
                db.LopHocDbSet.Remove(obj);
            }
            db.SaveChanges();
        }