コード例 #1
0
 public void AddPurchaseEvent(PurchaseEvent e)
 {
     using (var db = new ShopDataContext())
     {
         db.PurchaseEvents.InsertOnSubmit(e);
         db.SubmitChanges();
     }
 }
コード例 #2
0
        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();
                }
            }
        }
コード例 #3
0
 private void detach_PurchaseEvents(PurchaseEvent entity)
 {
     this.SendPropertyChanging();
     entity.Product = null;
 }
コード例 #4
0
 partial void DeletePurchaseEvent(PurchaseEvent instance);
コード例 #5
0
 partial void UpdatePurchaseEvent(PurchaseEvent instance);
コード例 #6
0
 partial void InsertPurchaseEvent(PurchaseEvent instance);
コード例 #7
0
 private void attach_PurchaseEvents(PurchaseEvent entity)
 {
     this.SendPropertyChanging();
     entity.Client = this;
 }