Example #1
0
        /// <summary>
        /// 首页
        /// </summary>
        /// <returns></returns>
        public ActionResult Index()
        {
            int NewArticleId = 5, CompanyId = 6;
            var model = new HomeListModel();

            //最新通知 4,  //公司新闻 3
            model.ArticleModels.AddRange(_newService.GetArticleById(NewArticleId).ToModelAsCollection <Article, ArticleModel>());
            model.ArticleModels.AddRange(_newService.GetArticleById(CompanyId).Take(3).ToModelAsCollection <Article, ArticleModel>());


            model.CountryList     = GetCommonCountryList();
            ViewBag.CountryList   = GetCountryList("");
            ViewBag.GoodsTypeList = GetGoodsTypeList();

            //主页顶级信息
            model.CategoryInfo = _newService.GetCategoryInfo("主页").ToModel <CategoryModel>();
            if (model.CategoryInfo != null)
            {
                ViewBag.Description = model.CategoryInfo.SeoDescription;
                ViewBag.SeoKey      = model.CategoryInfo.SeoKeywords;
            }

            model.ShowCategoryListModel = ShowCategoryListModel();

            return(View(model));
        }