Пример #1
0
        public void OnActionExecuted(ActionExecutedContext filterContext)
        {
            ICookieConsumer storage = DependencyResolver.Current.GetService <ICookieConsumer>();

            var language = storage.GetValueStorage(filterContext.HttpContext, ValuesApp.Language) ??
                           ValuesApp.LanguageDefault;

            Thread.CurrentThread.CurrentCulture   = CultureInfo.CreateSpecificCulture(language);
            Thread.CurrentThread.CurrentUICulture = CultureInfo.CreateSpecificCulture(language);

            var currency = storage.GetValueStorage(filterContext.HttpContext, ValuesApp.Currency) ??
                           ValuesApp.CurrencyDefault;

            Thread.CurrentThread.CurrentCulture.NumberFormat.CurrencySymbol   = ValuesApp.GetCurrencySymbol(language, currency);
            Thread.CurrentThread.CurrentUICulture.NumberFormat.CurrencySymbol = ValuesApp.GetCurrencySymbol(language, currency);
        }
Пример #2
0
 protected string GetCurrentCurrency()
 {
     return(_storage.GetValueStorage(HttpContext, ValuesApp.Currency)
            ?? ValuesApp.CurrencyDefault);
 }
Пример #3
0
 private string GetCurrentCurrency()
 {
     return(_storage.GetValueStorage(Request.Headers, ValuesApp.Currency)
            ?? ValuesApp.CurrencyDefault);
 }