public Cart(Guid cartID) { _context = new SmartNerdDataContext(); _order = (from o in _context.Orders where o.CartID == cartID select o).First(); }
public Cart() { _context = new SmartNerdDataContext(); _order = new DataModels.Order(); _context.Orders.InsertOnSubmit(_order); }
public void UseNewAddress(Address newAddress) { SmartNerdDataContext _context2 = new SmartNerdDataContext(); DataModels.Address _newAddress = new DataModels.Address { FullName = newAddress.FullName, City = newAddress.City, Line1 = newAddress.Line1, Line2 = newAddress.Line2, County = newAddress.County, StateOrProvince = newAddress.StateOrProvince, ZipCode = newAddress.ZipCode, }; _context2.Addresses.InsertOnSubmit(_newAddress); _context2.SubmitChanges(); _order.AddressID = _newAddress.AddressID; }