Exemplo n.º 1
0
        /// <summary>
        /// 获取前第15行数据
        /// </summary>
        /// <returns></returns>
        public static IList <Model.ContentDetail> GetListByNotice()
        {
            BLL.ContentDetail bll = new BLL.ContentDetail();

            if (!enableCaching)
            {
                return(bll.GetList(1, 15, "and ct.TypeName = '开奖公告'", null));
            }

            string key = "contentDetail_Notice";
            IList <Model.ContentDetail> data = (IList <Model.ContentDetail>)HttpRuntime.Cache[key];

            if (data == null)
            {
                data = bll.GetList(1, 15, "and ct.TypeName = '开奖公告'", null);

                AggregateCacheDependency cd = DependencyFactory.GetContentDetailDependency();
                HttpRuntime.Cache.Add(key, data, cd, DateTime.Now.AddHours(contentDetailTimeout), Cache.NoSlidingExpiration, CacheItemPriority.High, null);
            }

            return(data);
        }
Exemplo n.º 2
0
        public string GetSiteHelper()
        {
            string htmlAppend = string.Empty;

            if (ctBll == null)
            {
                ctBll = new BLL.ContentType();
            }
            if (cdBll == null)
            {
                cdBll = new BLL.ContentDetail();
            }
            cdList = cdBll.GetList();
            List <Model.ContentTypeInfo> ctList = ctBll.GetList();

            Model.ContentTypeInfo rootModel = ctList.Find(delegate(Model.ContentTypeInfo m) { return(m.TypeName == "站点所有帮助"); });
            if (rootModel != null)
            {
                htmlAppend += GetChildren(rootModel, ctList);
            }

            return(htmlAppend);
        }