public DS_Cart() { Purchase = new DS_Purchase(); Purchase.MemberID = 0; Purchase.CreateDate = DateTime.Now; Orders = new List <DS_Orders>(); OrderDetail = new List <DS_OrderDetail>(); }
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(); } }