public void ActivateKey(string key) { if (string.IsNullOrEmpty(key)) { throw new ArgumentNullException("key"); } var now = DateTime.UtcNow; var actionUrl = "/partnerapi/ActivateKey?code=" + HttpUtility.UrlEncode(key) + "&portal=" + HttpUtility.UrlEncode(TenantManager.GetCurrentTenant().TenantAlias); using var webClient = new WebClient(); webClient.Headers.Add("Authorization", GetPartnerAuthHeader(actionUrl)); try { webClient.DownloadData(partnerUrl + actionUrl); } catch (WebException we) { var error = GetException(we); if (error != null) { throw error; } throw; } tariffService.ClearCache(TenantManager.GetCurrentTenant().TenantId); var timeout = DateTime.UtcNow - now - TimeSpan.FromSeconds(5); if (TimeSpan.Zero < timeout) { // clear tenant cache Thread.Sleep(timeout); } TenantManager.GetTenant(TenantManager.GetCurrentTenant().TenantId); }
public void SaveSection <T>(string sectionName, T section) where T : class { SaveSection(TenantManager.GetCurrentTenant().TenantId, sectionName, section); }
public T GetSection <T>(string sectionName) where T : class { return(GetSection <T>(TenantManager.GetCurrentTenant().TenantId, sectionName)); }
public Uri GetShoppingUri(int quotaId, bool forCurrentTenant = true, string affiliateId = null, string currency = null, string language = null, string customerId = null) { return(tariffService.GetShoppingUri(forCurrentTenant ? TenantManager.GetCurrentTenant().TenantId : (int?)null, quotaId, affiliateId, currency, language, customerId)); }
private int GetTenant() { return(TenantManager.GetCurrentTenant().TenantId); }