public int Update(Supplier supplier) { String statement = QualifyTableName(DbDefault.GetUpdateStatement( TableName.SUPPLIER, new long[] { supplier.SupplierId })); if(Connection != null) return GFXDDbi.Update(Connection, BuildQuery(statement, supplier)); else return GFXDDbi.Update(BuildQuery(statement, supplier)); }
private String BuildQuery(String statement, Supplier supplier) { return String.Format(statement, GFXDDbi.Escape(supplier.Name), supplier.Address.AddressId, GFXDDbi.Escape(supplier.Phone), GFXDDbi.Escape(supplier.Email)); }
public Product() { ProductId = 0; Name = String.Empty; Description = String.Empty; Category = new Category(); Supplier = new Supplier(); UnitCost = 0; RetailPrice = 0; UnitsInStock = 0; ReorderQuantity = 0; LastOrderDate = DateTime.Today; NextOrderDate = DateTime.Today; }
public long Insert(Supplier supplier) { String statement = QualifyTableName(DbDefault.GetInsertStatement( TableName.SUPPLIER, new long[] { supplier.SupplierId })); statement = BuildQuery(statement, supplier); if(Connection != null) return GFXDDbi.Insert(Connection, statement); else return GFXDDbi.Insert(statement); }
public long UpdateSupplier(Supplier supplier) { return (new SupplierDao(Connection, SchemaName)).Update(supplier); }
public long AddSupplier(Supplier supplier) { return (new SupplierDao(Connection, SchemaName)).Insert(supplier); }
private static Supplier GetProductSupplier() { Supplier supplier = new Supplier(); supplier.SupplierId = DbHelper.GetRandomRowId( TableName.SUPPLIER.ToString(), DbDefault.GetTableStructure(TableName.SUPPLIER).PKColumns[0]); return supplier; }
private static Supplier GetSupplierInfo(Supplier supplier) { supplier.Name = GetSupplierName(); supplier.Address = GetSupplierAddress(); supplier.Phone = GetSupplierPhone(); supplier.Email = GetSupplierEmail(); return supplier; }
private static Supplier CreateSupplier() { Supplier supplier = new Supplier(); supplier.SupplierId = GetNewSupplierId(); return GetSupplierInfo(supplier); }