SuccessListViewModel SuccessListTest(int page) { //var newsList = new List<MODEL.News>(); //for (int i = 0; i < 300; i++) //{ // newsList.Add(new MODEL.News // { // NewsId = i, // Title = "成功案例标题" + i, // Content = "成功案例内容成功案例内容成功案例内容成功案例容成功案例内容成功案例内容成功案例内容成功案例内容成功案例内容成功案例内容成功案例内容成功案例内容", // ImgPath = "/image/pcpj.jpg", // PubDate = DateTime.Now, // ReadCount = 100 // }); //} var pagin = new Pagination(pageIndex: page - 1, recordCount: _successService.Count(null), pageSize: 6); return(new SuccessListViewModel(_successService.Get().OrderBy(e => e.Id).Skip(pagin.PageIndex * pagin.PageSize).Take(pagin.PageSize).ToList()) { Pagination = pagin, FriendlyViewModel = new FriendlyListViewModel { friendlylinks = _friendlylinkservice.Get().OrderBy(e => e.Id).ToList(), products = _product.Get().OrderBy(e => e.Id).Take(8).ToList() } }); }
public ActionResult Index() { var carouselList = new List <DATA.CarouselBase>(); var indexcarouselist = _carouselService.Get().OrderByDescending(e => e.Id).ToList(); indexcarouselist.ForEach(e => { carouselList.Add(new DATA.CarouselBase { ImgPath = e.ImgPath }); }); var viewModel = new HomeIndexViewModel { //大轮播图 //{ // new CarouselBase{Describe="1",ImgPath="/image/index_ban1.png"}, // new CarouselBase{Describe="2",ImgPath="/image/index_ban2.png"}, // new CarouselBase{Describe="3",ImgPath="/image/index_ban3.png"}, // new CarouselBase{Describe="4",ImgPath="/image/index_ban3.png"} //}) Carousel = new DATA.CarouselViewModel(carouselList) { ImgWidth = 1000, PreviewHtml = "<a href=\"javascript:;\" )><img src=\"{0}\" /></a>", ClassName = "banner" }, //产品展示轮播图 //ProductShow = new CarouselViewModel(new List<DATA.CarouselBase> //{ // new CarouselBase{Describe="1",ImgPath="/image/index.V3/index_productservice_one.png"}, // new CarouselBase{Describe="2",ImgPath="/image/index.V3/index_productservice_two.png"}, // new CarouselBase{Describe="3",ImgPath="/image/index.V3/index_productservice_three.png"}, // new CarouselBase{Describe="4",ImgPath="/image/index.V3/index_productservice_four.png"}, // new CarouselBase{Describe="5",ImgPath="/image/index.V3/index_productservice_five.png"} //}) //{ // ImgWidth = 235, // ImgHeight = 140, // ClassName = "productshow", // ShowCount = 4, // ImgMargin = 20 //} }; //产品服务 var bussinessTitle = _mainbussinessService.Get().OrderByDescending(e => e.Id).Take(7).ToList(); ViewBag.bussinessTitleShow = bussinessTitle; //品牌优势 var advantageList = _advantageService.Get().OrderByDescending(e => e.Id).Take(4).ToList(); ViewBag.advantageListShow = advantageList; //首页新闻中心倒序显示五条 var newsList = _newsService.Get().OrderByDescending(e => e.Id).Take(5).ToList(); ViewBag.NewsListShow = newsList; //首页成功案例倒序显示五条 var successList = _successService.Get().OrderByDescending(e => e.Id).Take(5).ToList(); ViewBag.SuccessListShow = successList; return(View(viewModel)); }