public long UpdateCustomer(Customer customer) { return (new CustomerDao(Connection, SchemaName)).Update(customer); }
private static Customer GetCustomerInfo(Customer customer) { customer.FirstName = GetCustomerFirstName(); customer.LastName = GetCustomerLastName(); customer.Address = GetCustomerAddress(); customer.Phone = GetCustomerPhone(); customer.Email = GetCustomerEmail(); customer.LastOrderDate = GetCustomerLastOrderDate(); return customer; }
public long AddCustomer(Customer customer) { return (new CustomerDao(Connection, SchemaName)).Insert(customer); }
private static Customer CreateCustomer() { Customer customer = new Customer(); customer.CustomerId = GetNewCustomerId(); return GetCustomerInfo(customer); }
private String BuildQuery(String statement, Customer customer) { return String.Format(statement, GFXDDbi.Escape(customer.FirstName), GFXDDbi.Escape(customer.LastName), customer.Address.AddressId, GFXDDbi.Escape(customer.Phone), GFXDDbi.Escape(customer.Email), GFXDDbi.Escape(customer.LastOrderDate.ToShortDateString())); }
public int Update(Customer customer) { String statement = QualifyTableName(DbDefault.GetUpdateStatement( TableName.CUSTOMER, new long[] { customer.CustomerId })); if(Connection != null) return GFXDDbi.Update(Connection,BuildQuery(statement, customer)); else return GFXDDbi.Update(BuildQuery(statement, customer)); }
public long Insert(Customer customer) { String statement = QualifyTableName(DbDefault.GetInsertStatement( TableName.CUSTOMER, new long[] { customer.CustomerId })); statement = BuildQuery(statement, customer); if(Connection != null) return GFXDDbi.Insert(Connection, statement); else return GFXDDbi.Insert(statement); }
public Order() { OrderId = 0; OrderDate = DateTime.Today; ShipDate = DateTime.Today; Customer = new Customer(); OrderDetails = new List<OrderDetail>(); SubTotal = 0; }