public static void AddSpecialInvent(SpecialInvent specialInvent) { using (restaurantEntities db = new restaurantEntities()) { db.SpecialInvent.Add(specialInvent); db.SaveChanges(); } }
public static void DeleteSpecialInvent(SpecialInvent specialInvent) { using (restaurantEntities db = new restaurantEntities()) { var o = db.SpecialInvent.Single(so => so.Id == specialInvent.Id); db.SpecialInvent.Remove(o); db.SaveChanges(); } }
public static void UpdateSpecialInvent(SpecialInvent specialInvent) { using (restaurantEntities db = new restaurantEntities()) { var o = db.SpecialInvent.Single(so => so.Id == specialInvent.Id); o.isContact = true; db.SaveChanges(); } }