コード例 #1
0
        public ActionResult News()
        {
            //--------------轮播区数据5条最新数据-----------
            ViewBag.RedLight = SeeNewsBll.LoadEntities(n => n.Type == "7").AsNoTracking().OrderByDescending(n => n.Intime)
                               .Take(5).ToList();
            //------------------5条置顶区------------------------
            ViewBag.FiveStick = SeeNewsBll.LoadEntities(n => n.Type == "10").AsNoTracking().OrderByDescending(n => n.Intime)
                                .Take(6).ToList();
            ViewBag.NewGame  = GetAllNews("1");
            ViewBag.HotGame  = GetAllNews("2");
            ViewBag.Industry = GetAllNews("3");

            ViewBag.SeeNewsNewGame  = SeeNewsBll.LoadEntities(n => n.Type == "1").AsNoTracking().OrderByDescending(n => n.Intime).Take(1).ToList();
            ViewBag.SeeNewsHotGame  = SeeNewsBll.LoadEntities(n => n.Type == "2").AsNoTracking().OrderByDescending(n => n.Intime).Take(1).ToList();
            ViewBag.SeeNewsIndustry = SeeNewsBll.LoadEntities(n => n.Type == "3").AsNoTracking().OrderByDescending(n => n.Intime).Take(1).ToList();
            ViewBag.NewsNewGameMsg  = NewsBll.GetNewAllMsgImg("1");        //1:新游在线(看新闻6条中是最后一条的一天数据)
            ViewBag.NewsHotGameMsg  = NewsBll.GetNewAllMsgImg("2");        //2热游动态
            ViewBag.NewsIndustryMsg = NewsBll.GetNewAllMsgImg("3");        //2热游动态
            ViewBag.NewestNewsPC    = GetNewestNewsPC();                   //获取最新的资讯15条(pc主机)
            ViewBag.NewsPcMsgImg    = NewsBll.GetAllNewsPcMsg("1");        //板块推荐  留言数
            ViewBag.DirectSeeding   = TwoSeeNewsImg("5");                  //2、2张带图的推荐位---直播热点
            ViewBag.MobileGame      = TwoSeeNewsImg("6");                  //2、2张带图的推荐位---手游
            ViewBag.DirectRec       = NewsBll.GetAllTypeNews("1", "5", 5); //直播版块最新5条数据
            ViewBag.MobileRec       = NewsBll.GetAllTypeNews("1", "6", 5); //手游版块最新5条数据
            //-------------------娱乐八卦读取--------------------------
            ViewBag.HappNews = NewsBll.GetAllHappyNews();
            return(View());
        }