Exemplo n.º 1
0
        public JsonResult UpdateCategoryShow(bool isShow, long id)
        {
            //_iShopCategoryService.UpdateCategoryShow(id, !isShow);
            var ids  = _iShopCategoryService.GetSecondAndThirdLevelCategories(new long[] { id }).Select(a => a.Id).ToList();
            var pids = _iShopCategoryService.GetParentCategoryById(id, isShow).Select(a => a.Id).ToList();

            if (ids != null)
            {
                ids.Add(id);
                _iShopCategoryService.UpdateCategorysShow(!isShow, ids);
                _iShopCategoryService.UpdateCategorysShow(!isShow, pids);
            }
            HttpResponse.RemoveOutputCacheItem(string.Format("/Shop/Home/{0}", this.CurrentShop.Id)); //移除页面缓存
            HttpResponse.RemoveOutputCacheItem(string.Format("/shop/home/{0}", this.CurrentShop.Id));
            return(Json(new { success = true }, JsonRequestBehavior.AllowGet));
        }