/// <summary> /// 获取后台类目集合 /// </summary> /// <returns></returns> public IEnumerable <ZTreeModel> SelectProductCategories() { try { return(handler.SelectProductCategories()); } catch (Exception ex) { logger.Log(Level.Error, string.Format("方法:{0},错误:{1}", "OperationCategoryManager.SelectProductCategories", ex.Message), ""); return(null); } }
/// <summary> /// 获取后台类目集合 /// </summary> /// <returns></returns> public IEnumerable <ZTreeModel> SelectProductCategories() { try { var productCategoryKey = "common.productCategory.DataList"; if (System.Web.HttpRuntime.Cache[productCategoryKey] == null) { var categories = handler.SelectProductCategories(); if (categories != null) { System.Web.HttpRuntime.Cache.Insert(productCategoryKey, categories, null, DateTime.Now.AddHours(3), System.Web.Caching.Cache.NoSlidingExpiration); } return(categories); } return(System.Web.HttpRuntime.Cache[productCategoryKey] as IEnumerable <ZTreeModel>); } catch (Exception ex) { logger.Log(Level.Error, string.Format("方法:{0},错误:{1}", "OperationCategoryManager.SelectProductCategories", ex.Message), ""); return(null); } }