public SyncroBasePresta() : base() { var logondata = LoginData(); _url = logondata.WebServiceUrl; _url += "api/"; _autKey = logondata.AuthKey; var config = ConfigurationManager.OpenExeConfiguration( Assembly.GetExecutingAssembly().Location); CheckModeDebug(config); if (config.AppSettings.Settings["Test"].Value == "1") { _url = config.AppSettings.Settings["UrlPrestaShop"].Value; _autKey = config.AppSettings.Settings["AutKey"].Value; //StrumentiMusicali.Core.Manager.ManagerLog.Logger.Info("TEST _url "); //StrumentiMusicali.Core.Manager.ManagerLog.Logger.Info(_url); } _imageFactory = new ImageFactory(_url, _autKey, ""); _StockAvailableFactory = new StockAvailableFactory(_url, _autKey, ""); _productFactory = new ProductFactory(_url, _autKey, ""); _categoriesFact = new CategoryFactory(_url, _autKey, ""); _taxRuleGroupFact = new TaxRuleGroupFactory(_url, _autKey, ""); }
public tax_rule_group GetTaxRuleGroupByRate(decimal rate) { var taxRules = TaxRuleFactory.GetByFilter(PsFilter.Create("id_country", DefaultCountry.id), null, null); foreach (var taxRule in taxRules) { if (taxRule.id_tax.HasValue && taxRule.id_tax_rules_group.HasValue) { var tax = TaxFactory.Get(taxRule.id_tax.Value); if (tax.rate == rate) { return(TaxRuleGroupFactory.Get(taxRule.id_tax_rules_group.Value)); } } } return(null); }