Ejemplo n.º 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));
        }
Ejemplo n.º 2
0
        //产品服务, 新闻中心, 关于我们, 帮助中心 顶部列表
        public ShowCategoryListModel ShowCategoryListModel()
        {
            var model = new ShowCategoryListModel();

            //产品与服务
            model.ShippingMethodServices = GetCategoryList();

            //关于我们
            int flag = 2;

            model.CategoryModelAbout = _newService.GetCategoryById(flag).ToModelAsCollection <Category, CategoryModel>();

            //新闻中心
            int fcategoryid = 1;

            model.CategoryModelNews = _newService.GetCategoryById(fcategoryid).ToModelAsCollection <Category, CategoryModel>();

            //帮助中心
            Category getCategory = _newService.GetCategoryInfo("帮助中心");

            model.HelpCenterList = GetCategoryModel(getCategory.CategoryID);


            return(model);
        }