コード例 #1
0
        /// <summary>
        /// 得到推荐文章
        /// </summary>
        /// <returns></returns>
        public List<PushInfo> ListNewByPush()
        {
            string SysName = CacheName.ListNewByPush.ToString();
            List<PushInfo> list = null;

            if (SysCache.Contains(SysName))
            {
                list= SysCache.Get(SysName) as List<PushInfo>;
            }
            if (list != null)
                return list;

            bizPushInfo bp = new bizPushInfo();
            list = bp.ListByTypeID(2, 10);
            SysCache.Add(SysName, list, new AbsoluteTime(DateTime.Now.AddMinutes(30)));
            return list;
        }
コード例 #2
0
        public ActionResult PushList(int id)
        {
            string source = Request.QueryString["source"].ToString();
            bizPushInfoType bpt = new bizPushInfoType();
            bizPushInfo bp = new bizPushInfo();
            PushInfoType model = bpt.Get(id);
            ViewData["listType"] = bpt.ListByTypeSource(model.TypeSource);
            ViewData["Type"] = model;
            ViewData["id"] = id;
            ViewData["source"] = source;
            List<PushInfo> listInfo = bp.ListByTypeID(id, 10);

            return View(listInfo);
        }