public static void ThemLH(LopHoc lh) { try { var db = new ConnectionsDBContext(); db.LopHocDbSet.Add(lh); db.SaveChanges(); } catch (Exception ex) { } }
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(); }