Beispiel #1
0
        private bool LoadByPrimaryKeyDynamic(System.Int32 storeId, System.String countryCode, System.String region)
        {
            TaxRegionQuery query = new TaxRegionQuery();

            query.Where(query.StoreId == storeId, query.CountryCode == countryCode, query.Region == region);
            return(this.Load(query));
        }
Beispiel #2
0
        protected void InitQuery(TaxRegionQuery query)
        {
            query.OnLoadDelegate = this.OnQueryLoaded;

            if (!query.es2.HasConnection)
            {
                query.es2.Connection = ((IEntityCollection)this).Connection;
            }
        }
        public static IList <TaxRegion> GetTaxRegions(int storeId)
        {
            TaxRegionQuery q = new TaxRegionQuery();

            q.Where(q.StoreId == storeId);
            q.OrderBy(q.CountryCode.Ascending, q.Region.Ascending);

            TaxRegionCollection collection = new TaxRegionCollection();

            collection.Load(q);

            return(collection);
        }
Beispiel #4
0
        private static decimal?GetTaxRateForRegion(int storeId, string countryCode, string region)
        {
            TaxRegionQuery q = new TaxRegionQuery();

            q.es.Top = 1;
            q.Select(q.TaxRate);
            q.Where(q.StoreId == storeId, q.CountryCode == countryCode, q.Region == region);

            object rate = q.ExecuteScalar();

            if (rate != null)
            {
                return(WA.Parser.ToDecimal(rate));
            }
            return(null);
        }
Beispiel #5
0
 public bool Load(TaxRegionQuery query)
 {
     this.query = query;
     InitQuery(this.query);
     return(Query.Load());
 }