Exemplo n.º 1
0
        private static Address CreateAddress()
        {
            Address address = new Address();
            address.AddressId = GetNewAddressId();

            return GetAddressInfo(address);
        }
Exemplo n.º 2
0
        private static Address GetAddressInfo(Address address)
        {
            address.Address1 = GetAddress1();
            address.Address2 = GetAddress2();
            address.Address3 = GetAddress3();
            address.City = GetCity();
            address.State = GetState();
            address.ZipCode = GetZipCode();
            address.Province = GetProvince();
            address.CountryCode = GetCountryCode();

            return address;
        }
Exemplo n.º 3
0
 public Customer()
 {
     CustomerId = 0;
     FirstName = String.Empty;
     LastName = String.Empty;
     Address = new Address();
     Phone = String.Empty;
     Email = String.Empty;
     LastOrderDate = DateTime.Today;
 }
Exemplo n.º 4
0
 public long UpdateAddress(Address address)
 {
     return (new AddressDao(Connection, SchemaName)).Update(address);
 }
Exemplo n.º 5
0
 public long AddAddress(Address address)
 {
     return (new AddressDao(Connection, SchemaName)).Insert(address);
 }
Exemplo n.º 6
0
        private static Address GetCustomerAddress()
        {
            Address address = new Address();
            address.AddressId = DbHelper.GetRandomRowId(
                TableName.ADDRESS.ToString(),
                DbDefault.GetTableStructure(TableName.ADDRESS).PKColumns[0]);

            return address;
        }
Exemplo n.º 7
0
 private String BuildQuery(String statement, Address address)
 {
     return String.Format(statement,
         GFXDDbi.Escape(address.Address1),
         GFXDDbi.Escape(address.Address2),
         GFXDDbi.Escape(address.Address3),
         GFXDDbi.Escape(address.City),
         GFXDDbi.Escape(address.State.ToString()),
         GFXDDbi.Escape(address.ZipCode.ToString()),
         GFXDDbi.Escape(address.Province.ToString()),
         (int)address.CountryCode);
 }
Exemplo n.º 8
0
        public int Update(Address address)
        {
            String statement = QualifyTableName(DbDefault.GetUpdateStatement(
                TableName.ADDRESS, new long[] { address.AddressId }));

            if (Connection != null)
                return GFXDDbi.Update(Connection, BuildQuery(statement, address));
            else
                return GFXDDbi.Update(BuildQuery(statement, address));
        }
Exemplo n.º 9
0
        public long Insert(Address address)
        {
            String statement = QualifyTableName(DbDefault.GetInsertStatement(
                TableName.ADDRESS, new long[] { address.AddressId }));

            statement = BuildQuery(statement, address);

            if (Connection != null)
                return GFXDDbi.Insert(Connection, statement);
            else
                return GFXDDbi.Insert(statement);
        }