Esempio n. 1
0
        public string RenderToken(TokenHandlerContext context)
        {
            if (!Tokens.Contains(context.Token, StringComparer.OrdinalIgnoreCase))
            {
                return(null);
            }

            return(string.Format(@"
				<!--
					PAGE INVOCATION: {0}
					PAGE REFERRER: {1}
					STORE LOCALE: {2}
					STORE CURRENCY: {3}
					CUSTOMER ID: {4}
					AFFILIATE ID: {5}
					CUSTOMER LOCALE: {6}
					CURRENCY SETTING: {7}
					CACHE MENUS: {8}
				-->"                ,
                                 Server.HtmlEncode(CommonLogic.PageInvocation()),
                                 Server.HtmlEncode(CommonLogic.PageReferrer()),
                                 Localization.GetDefaultLocale(),
                                 Localization.GetPrimaryCurrency(),
                                 context.Customer.CustomerID,
                                 context.Customer.AffiliateID,
                                 context.Customer.LocaleSetting,
                                 context.Customer.CurrencySetting,
                                 AppLogic.AppConfigBool("CacheMenus")));
        }
Esempio n. 2
0
        public string RenderToken(TokenHandlerContext context)
        {
            if (!Tokens.Contains(context.Token, StringComparer.OrdinalIgnoreCase))
            {
                return(null);
            }

            return(Server.HtmlEncode(CommonLogic.PageInvocation()));
        }
Esempio n. 3
0
        public void Render(ViewContext viewContext, System.IO.TextWriter writer)
        {
            ViewDataDictionary    data   = viewContext.ViewData;
            HttpServerUtilityBase server = viewContext.HttpContext.Server;

            foreach (var kvp in data)
            {
                this.viewBody = this.viewBody.Replace("${" + kvp.Key + "}", server.HtmlEncode(kvp.Value == null ? "" : kvp.Value.ToString()));
            }
            writer.Write(this.viewBody);
        }
Esempio n. 4
0
        public ShoppingCartRemoveViewModel removePizzaFromCart(DataContext context, HttpContextBase httpContext, HttpServerUtilityBase server, int id)
        {
            var    cart      = cartProcessingService.GetCart(httpContext);
            string pizzaName = context.Carts.FirstOrDefault(item => item.PizzaId == id).Pizza.Name;

            int itemCount = orderProcessingService.RemoveFromCart(id, cart);

            return(new ShoppingCartRemoveViewModel
            {
                Message = server.HtmlEncode(pizzaName) + " has been removed from your shopping cart",
                CartTotal = getTotalPrice(httpContext),
                CartCount = getCartCount(httpContext),
                ItemCount = itemCount,
                DeleteId = id
            });
        }
Esempio n. 5
0
 public override string HtmlEncode(string s)
 {
     return(_server.HtmlEncode(s));
 }