public void AddPurchaseEvent(PurchaseEvent e) { using (var db = new ShopDataContext()) { db.PurchaseEvents.InsertOnSubmit(e); db.SubmitChanges(); } }
public void DeletePurchaseEvent(int id) { using (var db = new ShopDataContext()) { PurchaseEvent eventToDelete = db.PurchaseEvents.FirstOrDefault(e => e.Id.Equals(id)); if (eventToDelete != null) { db.PurchaseEvents.DeleteOnSubmit(eventToDelete); db.SubmitChanges(); } } }
private void detach_PurchaseEvents(PurchaseEvent entity) { this.SendPropertyChanging(); entity.Product = null; }
partial void DeletePurchaseEvent(PurchaseEvent instance);
partial void UpdatePurchaseEvent(PurchaseEvent instance);
partial void InsertPurchaseEvent(PurchaseEvent instance);
private void attach_PurchaseEvents(PurchaseEvent entity) { this.SendPropertyChanging(); entity.Client = this; }