Exemplo n.º 1
0
        private void GetStoreListNew(HttpContext context)
        {
            PageModel <StoreEntity> value = new PageModel <StoreEntity>();
            StoreEntityQuery        storeQueryFromCookie = DepotHandler.GetStoreQueryFromCookie(context);

            if (storeQueryFromCookie != null)
            {
                storeQueryFromCookie.ProductType = ProductType.All;
                value = StoreListHelper.GetStoreRecommend(storeQueryFromCookie);
            }
            string s = JsonConvert.SerializeObject(value);

            context.Response.ContentType = "text/json";
            context.Response.Write(s);
        }
Exemplo n.º 2
0
        private void GetRecomStoreByProductId(HttpContext context)
        {
            List <StoreBaseEntity> source = new List <StoreBaseEntity>();
            StoreEntityQuery       query  = DepotHandler.GetStoreQueryFromCookie(context);

            if (query != null)
            {
                source = StoreListHelper.GetStoreRecommendByProductId(query);
            }
            var value = (from a in source
                         select new
            {
                a.StoreId,
                a.StoreName,
                a.Distance,
                query.ProductId
            }).ToList();
            string s = JsonConvert.SerializeObject(value);

            context.Response.ContentType = "text/json";
            context.Response.Write(s);
        }