public void SetCurrentMarket(MarketId marketId)
        {
            var market = _marketService.GetMarket(marketId);

            if (market != null)
            {
                var cookie = new MarketCookie()
                {
                    MarketId = marketId.Value
                };
                _cookieRepository.Set(MarketCookie.CookieName, new TimeSpan(100, 0, 0, 0, 0), cookie);
            }
        }
示例#2
0
        public bool SetCurrentCurrency(string currencyCode)
        {
            var currentMaket = _currentMarket.GetCurrentMarket();
            var currency     = currentMaket.Currencies.FirstOrDefault(x => x.CurrencyCode == currencyCode);

            if (currency != null)
            {
                var currencyCookie = _cookieRepository.Set <CurrencyCookie>(CurrencyCookie.CookieName, new TimeSpan(100, 0, 0, 0), new CurrencyCookie()
                {
                    CurrencytId = currencyCode
                });
                return(true);
            }
            return(false);
        }