// GET: backend/Category public ActionResult Index() { // search category within product PageReq pager = new PageReq(); var pageData = jlService.ProductCategoryPage(pager); return(View(pageData)); }
public void InitializeCategories(ViewDataDictionary viewData, int?category, string key = null) { var pager = PageReq.Create(); var categories = jlService.ProductCategoryPage(pager); if (categories != null) { viewData[key ?? "categories"] = new SelectList(categories.Data, "AutoId", "Name", category); } }
// 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)); }
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()); }