コード例 #1
0
        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));
        }
コード例 #2
0
 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));
 }
コード例 #3
0
ファイル: Product.cs プロジェクト: leloulight/gemfirexd-oss
 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;
 }
コード例 #4
0
        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);
        }
コード例 #5
0
 public long UpdateSupplier(Supplier supplier)
 {
     return (new SupplierDao(Connection, SchemaName)).Update(supplier);
 }
コード例 #6
0
 public long AddSupplier(Supplier supplier)
 {
     return (new SupplierDao(Connection, SchemaName)).Insert(supplier);
 }
コード例 #7
0
        private static Supplier GetProductSupplier()
        {
            Supplier supplier = new Supplier();
            supplier.SupplierId = DbHelper.GetRandomRowId(
                TableName.SUPPLIER.ToString(), 
                DbDefault.GetTableStructure(TableName.SUPPLIER).PKColumns[0]);

            return supplier;
        }
コード例 #8
0
        private static Supplier GetSupplierInfo(Supplier supplier)
        {
            supplier.Name = GetSupplierName();
            supplier.Address = GetSupplierAddress();
            supplier.Phone = GetSupplierPhone();
            supplier.Email = GetSupplierEmail();

            return supplier;
        }
コード例 #9
0
        private static Supplier CreateSupplier()
        {
            Supplier supplier = new Supplier();
            supplier.SupplierId = GetNewSupplierId();

            return GetSupplierInfo(supplier);
        }