コード例 #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));
        }
コード例 #2
0
        /// <summary>
        ///  联系我们
        /// </summary>
        /// <returns></returns>
        public ActionResult ContactUs(int?id)
        {
            if (id.Value != 4)
            {
                if (_newService.CategoryId(id.Value) != 4)
                {
                    throw new Exception("输入的参数有误");
                }
            }
            else if (id.Value == 0)
            {
                throw new Exception("输入的参数有误");
            }
            HomeListModel model = new HomeListModel();

            if (_newService.Category(id.Value))
            {
                //根据一级标题查询一个二级标题Id
                int categoryId = _newService.CategoryId(id.Value);
                model.CategoryId     = categoryId;
                model.CategoryModels = _newService.GetCategoryById(id.Value).ToModelAsCollection <Category, CategoryModel>();
                model.CategoryModel  = _newService.GetCategory(categoryId).ToModel <CategoryModel>();
            }
            else
            {
                model.CategoryId = id.Value;
                //根据二级标题去查询一级标题的Id
                model.CategoryModels = _newService.GetCategoryById(_newService.CategoryId(id.Value)).ToModelAsCollection <Category, CategoryModel>();
                model.CategoryModel  = _newService.GetCategory(id.Value).ToModel <CategoryModel>();
            }
            return(View(model));
        }
コード例 #3
0
        public ActionResult Index()
        {
            HomeListModel model = new HomeListModel(this.MobiContext);

            model.Content        = MobiContext.Service.Cache.Take(8);
            model.DefaultDisplay = 8;
            model.ProfileCount   = MobiContext.Service.Cache.Count;
            string homeView = this.MobiContext.Service.HomeView;

            return(View(this.MobiContext.Service.HomeView, model));
        }
コード例 #4
0
        public ActionResult Index(HomeListModel viewModel)
        {
            string country = viewModel.FreightTrialFilter.CountryCode;

            string length = viewModel.FreightTrialFilter.Length.Replace("cm", "");
            string height = viewModel.FreightTrialFilter.Height.Replace("cm", "");
            string width  = viewModel.FreightTrialFilter.Width.Replace("cm", "");

            return(RedirectToAction("FreightTrial", "Billing", new { countryCode = country, weight = viewModel.FreightTrialFilter.Weight, length = length, height = height, width = width, packageType = viewModel.FreightTrialFilter.PackageType }));
            //return RedirectToAction("FreightTrial", "Billing", new { countryCode = viewModel.FreightTrialFilter.CountryCode, weight = viewModel.FreightTrialFilter.Weight, length = viewModel.FreightTrialFilter.Length, height = viewModel.FreightTrialFilter.Height, width = viewModel.FreightTrialFilter.Width, packageType = viewModel.FreightTrialFilter.PackageType });
        }
コード例 #5
0
        // SUMMARY: ajax method appending content ( d = skip, g = get )
        public ActionResult LoadMore(string d, string g)
        {
            int skip = 0, get = 0;

            if (!Int32.TryParse(d, out skip) || !Int32.TryParse(g, out get))
            {
                Log.Error("Could not parse get or skip.");
                return(this.InternalError());
            }

            HomeListModel model = new HomeListModel(this.MobiContext);

            model.Content = this.MobiContext.Service.Cache.Take(get, skip);
            return(PartialView(this.MobiContext.Service.PartialHomeView, model));
        }
コード例 #6
0
        /// <summary>
        ///  关于我们
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult About(int id)
        {
            if (_newService.GetCategory(id) == null)
            {
                throw new Exception("输入的参数有误");
            }

            HomeListModel model = new HomeListModel();

            model.ShowCategoryListModel = ShowCategoryListModel();
            model.CategoryInfo          = _newService.GetCategory(id).ToModel <CategoryModel>();
            model.GetId = id;

            return(View(model));
        }
コード例 #7
0
        /// <summary>
        /// 产品与服务
        /// </summary>
        /// <returns></returns>
        public ActionResult ProductServices(int id)
        {
            if (_newService.GetCategory(id) == null)
            {
                throw new Exception("输入的参数有误!");
            }

            HomeListModel model = new HomeListModel();

            //获取当前类别信息
            model.CategoryInfo          = _newService.GetCategory(id).ToModel <CategoryModel>();
            model.GetId                 = model.CategoryInfo.CategoryID;
            model.ShowCategoryListModel = ShowCategoryListModel();

            return(View(model));
        }
コード例 #8
0
        /// <summary>
        /// 帮助中心
        /// add by yungchu
        /// </summary>
        /// <returns></returns>
        public ActionResult HelpCenter(int id)
        {
            //获取帮助中心信息
            if (_newService.GetCategory(id) == null)
            {
                throw new Exception("输入的参数有误!");
            }

            HomeListModel model = new HomeListModel();

            model.ShowCategoryListModel = ShowCategoryListModel();

            model.CategoryInfo = _newService.GetCategory(id).ToModel <CategoryModel>();
            model.GetId        = model.CategoryInfo.CategoryID;

            return(View(model));
        }