Ejemplo n.º 1
0
        // GET: Product
        public ActionResult Index(int id = 0)
        {
            // category
            PageReq pager        = new PageReq();
            var     categoryData = jlService.ProductCategoryPage(pager);

            ViewBag.Categories = categoryData;

            if (id < 1)
            {
                var page     = PageReq.Create();
                var products = jlService.ProductPage(page);
                var p        = products.Data.FirstOrDefault();
                return(View(p));
            }

            var product = jlService.GetProduct(id);

            return(View(product));
        }
Ejemplo n.º 2
0
        // GET: backend/Product

        public ActionResult Index(ProductSearchModel searchTo, int page = 0)
        {
            var filter = new JL.Core.Filters.ProductFilter();

            filter.CategoryId = searchTo.CategoryId;
            filter.Title      = searchTo.Title;
            var pager = PageReq <JL.Core.Filters.ProductFilter> .Create(filter, page);

            // search page
            var data = jlService.ProductPage(pager);

            new ViewDataHelper(jlService).InitializeCategories(ViewData, 0, "categoryid");
            ViewBag.productQuery = searchTo;
            ViewBag.ReturnUrl    = Request.Url.PathAndQuery;
            return(View(data));
        }
Ejemplo n.º 3
0
        public ActionResult Index()
        {
            // 新品推荐
            var recommendProducts = jlService.GetProductsRecommends();

            ViewBag.RecommendProducts = recommendProducts;

            // 产品中心
            ProductFilter filter = new ProductFilter();

            filter.Status = 0;
            var productCenter = jlService.ProductPage(PageReq <ProductFilter> .Create(filter, pageSize: 6));

            ViewBag.ProductCenter = productCenter.Data;

            // 套装系列
            var pager = PageReq.Create(pageSize: 5);

            jlService.ProductCategoryPage(pager);

            // members
            MemberFilter mf      = new MemberFilter();
            var          members = jlService.MemberPage(PageReq <MemberFilter> .Create(mf, pageSize: 5));

            ViewBag.Members = members.Data;

            // 资讯中心
            ArticleFilter af = new ArticleFilter();

            af.Status = Consts.ArticleStatus_Published;
            var articlePager = PageReq <ArticleFilter> .Create(af, pageSize : 8);

            articlePager.OrderBy = " order by addtime desc ";
            var articles = jlService.ArticlePage(articlePager);

            ViewBag.Articles = articles.Data;

            return(View());
        }