public void Update(DS_Purchase Purchase) { using (var ct = new DS_PurchaseDataContext(DbHelperSQL.Connection)) { ct.DS_Purchase.Attach(Purchase, true); ct.SubmitChanges(); } }
public void Add(DS_Purchase Purchase) { using (var ct = new DS_PurchaseDataContext(DbHelperSQL.Connection)) { ct.DS_Purchase.InsertOnSubmit(Purchase); ct.SubmitChanges(); } }
public void Delete(int ID) { using (var ct = new DS_PurchaseDataContext(DbHelperSQL.Connection)) { DS_Purchase st = ct.DS_Purchase.Single(a => a.ID == ID); ct.DS_Purchase.DeleteOnSubmit(st); ct.SubmitChanges(); } }