public int Update(Order order) { String statement = QualifyTableName(DbDefault.GetUpdateStatement( TableName.ORDERS, new long[] { order.OrderId })); File.AppendAllText(@"C:\ORDERS.txt", statement); if(Connection != null) return GFXDDbi.Update(Connection, BuildQuery(statement, order)); else return GFXDDbi.Update(BuildQuery(statement, order)); }
private String BuildQuery(String statement, Order order) { return String.Format(statement, GFXDDbi.Escape(order.OrderDate.ToShortDateString()), GFXDDbi.Escape(order.ShipDate.ToShortDateString()), order.Customer.CustomerId, order.SubTotal); }
public long Insert(Order order) { String statement = QualifyTableName(DbDefault.GetInsertStatement( TableName.ORDERS, new long[] { order.OrderId })); statement = BuildQuery(statement, order); if(Connection != null) return GFXDDbi.Insert(Connection, statement); else return GFXDDbi.Insert(statement); }
public long UpdateOrder(Order order) { return (new OrderDao(Connection, SchemaName)).Update(order); }
public long AddOrder(Order order) { return (new OrderDao(Connection, SchemaName)).Insert(order); }
private static Order GetOrderInfo(Order order) { order.OrderDate = GetOrderDate(); order.ShipDate = GetOrderShipDate(); order.Customer = GetOrderCustomer(); order.OrderDetails = new List<OrderDetail>(); order.SubTotal = GetOrderSubTotal(); return order; }
private static Order CreateOrder() { Order order = new Order(); order.OrderId = GetNewOrderId(); return GetOrderInfo(order); }