private void GetStoreSettings() { Hashtable hst = new Hashtable(); StoreSettingProvider sep = new StoreSettingProvider(); if (HttpContext.Current.Cache["AspxStoreSetting" + GetPortalID.ToString() + GetStoreID.ToString()] != null) { hst = (Hashtable)HttpContext.Current.Cache["AspxStoreSetting" + GetPortalID.ToString() + GetStoreID.ToString()]; StoreSettingConfig ssc = new StoreSettingConfig(); decimal timeToDeleteCartItems = decimal.Parse(ssc.GetStoreSettingsByKey(StoreSetting.TimeToDeleteAbandonedCart, GetStoreID, GetPortalID, GetCurrentCultureName)); decimal timeToAbandonCart = Convert.ToDecimal(ssc.GetStoreSettingsByKey(StoreSetting.CartAbandonedTime, GetStoreID, GetPortalID, GetCurrentCultureName)); ctl.DeleteAbandonedCartItems(GetStoreID, GetPortalID, timeToDeleteCartItems, timeToAbandonCart); } else { DataTable dt = sep.GetStoreSettings(GetStoreID, GetPortalID, GetCurrentCultureName); if (dt != null && dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { hst.Add(dt.Rows[i]["SettingKey"].ToString(), dt.Rows[i]["SettingValue"].ToString()); StoreSettingConfig ssc = new StoreSettingConfig(); decimal timeToDeleteCartItems = decimal.Parse(ssc.GetStoreSettingsByKey(StoreSetting.TimeToDeleteAbandonedCart, GetStoreID, GetPortalID, GetCurrentCultureName)); decimal timeToAbandonCart = Convert.ToDecimal(ssc.GetStoreSettingsByKey(StoreSetting.CartAbandonedTime, GetStoreID, GetPortalID, GetCurrentCultureName)); ctl.DeleteAbandonedCartItems(GetStoreID, GetPortalID, timeToDeleteCartItems, timeToAbandonCart); } HttpContext.Current.Cache.Insert("AspxStoreSetting" + GetPortalID.ToString() + GetStoreID.ToString(), hst); } } }
protected void Page_Load(object sender, EventArgs e) { int StoreID, PortalID; int CustomerID; string UserName, CultureName, SessionCode; SetCustomerID(); GetPortalCommonInfo(out StoreID, out PortalID, out CustomerID, out UserName, out CultureName, out SessionCode); AspxCommonInfo aspxCommonObj = new AspxCommonInfo(StoreID, PortalID, UserName, CultureName, CustomerID, SessionCode); StoreSettingConfig ssc = new StoreSettingConfig(); string timeToDeleteCartItems, timeToAbandonCart; ssc.GetStoreSettingParamTwo(StoreSetting.TimeToDeleteAbandonedCart, StoreSetting.CartAbandonedTime, out timeToDeleteCartItems, out timeToAbandonCart, StoreID, PortalID, CultureName); ctl.DeleteAbandonedCartItems(StoreID, PortalID, decimal.Parse(timeToDeleteCartItems), decimal.Parse(timeToAbandonCart)); StoreAccessDetailsInfo storeAccessTracker = new StoreAccessDetailsInfo(); storeAccessTracker.PortalID = PortalID; storeAccessTracker.StoreID = StoreID; storeAccessTracker.Username = UserName; StartUpInfoCollection objStartInfo = new StartUpInfoCollection(); AspxCommonController objCommonCont = new AspxCommonController(); objStartInfo = objCommonCont.GetStartUpInformation("AspxKPI", "AspxABTesting", storeAccessTracker); CheckStoreAccessible(aspxCommonObj, objStartInfo.IsStoreAccess, objStartInfo.IsStoreClosed); CreateGlobalVariables(aspxCommonObj, objStartInfo.IsKPIInstalled, objStartInfo.IsABTestInstalled); IncludeCoreLanguageJS(); IncludeTemplateLanguageJS(); IncludeRssFeedLanguageJS(); if (HttpContext.Current.Session["IsLoginClick" + UserName] != null) { if (bool.Parse(HttpContext.Current.Session["IsLoginClick" + UserName].ToString())) { objCommonCont.UpdateCartAnonymoususertoRegistered(StoreID, PortalID, CustomerID, SessionCode); HttpContext.Current.Session["IsLoginClick" + UserName] = false; } } List <CurrrencyRateInfo> ratelist = GetCountryCodeRates(aspxCommonObj); JavaScriptSerializer json_serializer = new JavaScriptSerializer(); string jsonRates = json_serializer.Serialize(ratelist); ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "ratelist", " var currencyRate='" + jsonRates + "';", true); }