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)); }
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); }
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); }