Exemple #1
0
        public void GetStoreSettingParamTwo(string key1, string key2, out string value1, out string value2,
                                            int storeID, int portalID, string cultureName)
        {
            try
            {
                string strStoreID        = storeID.ToString();
                string strPortalID       = portalID.ToString();
                StoreSettingProvider sep = new StoreSettingProvider();
                Hashtable            hst = new Hashtable();
                if (HttpContext.Current.Cache["AspxStoreSetting" + strPortalID + strStoreID] != null)
                {
                    hst = (Hashtable)HttpContext.Current.Cache["AspxStoreSetting" + strPortalID + strStoreID];
                }
                else
                {
                    DataTable dt = sep.GetStoreSettings(storeID, portalID, cultureName); //GetSettingsByPortal();
                    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());
                        }
                    }
                }
                //need to be cleared when any key is chnaged
                HttpContext.Current.Cache.Insert("AspxStoreSetting" + strPortalID + strStoreID, hst);//

                value1 = hst[strPortalID + strStoreID + "." + key1].ToString();
                value2 = hst[strPortalID + strStoreID + "." + key2].ToString();
            }
            catch (Exception e)
            {
                throw e;
            }
        }
Exemple #2
0
        public string GetStoreSettingsByKey(string key, int storeID, int portalID, string cultureName)
        {
            try
            {
                string strValue;
                StoreSettingProvider sep = new StoreSettingProvider();
                Hashtable            hst = new Hashtable();
                if (HttpContext.Current.Cache["AspxStoreSetting" + portalID.ToString() + storeID.ToString()] != null)
                {
                    hst = (Hashtable)HttpContext.Current.Cache["AspxStoreSetting" + portalID.ToString() + storeID.ToString()];
                }
                else
                {
                    DataTable dt = sep.GetStoreSettings(storeID, portalID, cultureName); //GetSettingsByPortal();
                    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());
                        }
                    }
                }
                //need to be cleared when any key is chnaged
                HttpContext.Current.Cache.Insert("AspxStoreSetting" + portalID.ToString() + storeID.ToString(), hst);//

                strValue = hst[portalID.ToString() + storeID.ToString() + "." + key].ToString();
                return(strValue);
            }
            catch (Exception e)
            {
                throw e;
            }
        }
        public string GetStoreSettingsByKey(string key, int storeID, int portalID, string cultureName)
        {
            try
            {
                string strValue;
                StoreSettingProvider sep = new StoreSettingProvider();
                Hashtable hst = new Hashtable();
                if (HttpContext.Current.Cache["AspxStoreSetting"+portalID.ToString()+storeID.ToString()] != null)
                {
                    hst = (Hashtable)HttpContext.Current.Cache["AspxStoreSetting"+portalID.ToString()+storeID.ToString()];
                }
                else
                {
                    DataTable dt = sep.GetStoreSettings(storeID, portalID, cultureName); //GetSettingsByPortal();
                    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());
                        }
                    }
                }
                //need to be cleared when any key is chnaged
                HttpContext.Current.Cache.Insert("AspxStoreSetting"+portalID.ToString()+storeID.ToString(), hst);//

                strValue = hst[portalID.ToString() + storeID.ToString() + "." + key].ToString();
                return strValue;
            }
            catch (Exception e)
            {
                throw e;
            }
        }
 public void ResetStoreSettingKeys(int storeID, int portalID, string cultureName)
 {
     StoreSettingProvider sep = new StoreSettingProvider();
     Hashtable hst = new Hashtable();
     DataTable dt = sep.GetStoreSettings(storeID, portalID, cultureName);
     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());
         }
     }
     //need to be cleared when any key is chnaged
     HttpContext.Current.Cache.Insert("AspxStoreSetting" + portalID.ToString() + storeID.ToString(), hst);//
 }
Exemple #5
0
        public void ResetStoreSettingKeys(int storeID, int portalID, string cultureName)
        {
            StoreSettingProvider sep = new StoreSettingProvider();
            Hashtable            hst = new Hashtable();
            DataTable            dt  = sep.GetStoreSettings(storeID, portalID, cultureName);

            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());
                }
            }
            //need to be cleared when any key is chnaged
            HttpContext.Current.Cache.Insert("AspxStoreSetting" + portalID.ToString() + storeID.ToString(), hst);//
        }
        public void GetStoreSettingParamThree(string key1, string key2, string key3, out string value1, out string value2, 
            out string value3, int storeID, int portalID, string cultureName)
        {
            try
            {
                string strStoreID = storeID.ToString();
                string strPortalID = portalID.ToString();
                StoreSettingProvider sep = new StoreSettingProvider();
                Hashtable hst = new Hashtable();
                if (HttpContext.Current.Cache["AspxStoreSetting" + strPortalID+ strStoreID] != null)
                {
                    hst = (Hashtable)HttpContext.Current.Cache["AspxStoreSetting" + strPortalID+ strStoreID];
                }
                else
                {
                    DataTable dt = sep.GetStoreSettings(storeID, portalID, cultureName); //GetSettingsByPortal();
                    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());
                        }
                    }
                }
                //need to be cleared when any key is chnaged
                HttpContext.Current.Cache.Insert("AspxStoreSetting" + strPortalID+ strStoreID, hst);//

                value1 = hst[strPortalID+ strStoreID + "." + key1].ToString();
                value2 = hst[strPortalID+ strStoreID + "." + key2].ToString();
                value3 = hst[strPortalID+ strStoreID + "." + key3].ToString();

            }
            catch (Exception e)
            {
                throw e;
            }
        }
    private List<CurrrencyRateInfo> GetCountryCodeRates(AspxCommonInfo aspxCommonObj)
    {
        Hashtable hst = new Hashtable();
        StoreSettingProvider sep = new StoreSettingProvider();
        if (HttpContext.Current.Cache["AspxCurrencyRate" + aspxCommonObj.PortalID.ToString() + aspxCommonObj.StoreID.ToString()] != null)
        {
            hst = (Hashtable)HttpContext.Current.Cache["AspxCurrencyRate" + aspxCommonObj.PortalID.ToString() + aspxCommonObj.StoreID.ToString()];

            List<CurrrencyRateInfo> currencies = (List<CurrrencyRateInfo>)hst["CURRENCY"];
            return currencies;
        }
        else
        {
            List<CurrrencyRateInfo> currencyRate = AspxCurrencyController.GetCountryCodeRates(aspxCommonObj);
            if (currencyRate.Count > 0)
            {
                hst.Add("CURRENCY", currencyRate);
                HttpContext.Current.Cache.Insert("AspxCurrencyRate" + aspxCommonObj.PortalID.ToString() + aspxCommonObj.StoreID.ToString(), hst);
            }
            
            return currencyRate;
        }
    }
 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);
         }
     }
 }
 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()];
     }
     else
     {
         DataTable dt = sep.GetStoreSettings(GetStoreID, GetPortalID, GetCurrentCultureName); //GetSettingsByPortal();   
         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());
             }
         }
     }
     HttpContext.Current.Cache.Insert("AspxStoreSetting" + GetPortalID.ToString() + GetStoreID.ToString(), hst);
 }