public ActionResult Ajax_QueryFood() { var pageIndex = int.Parse(Request["page"]); var pageSize = int.Parse(Request["size"]); var result = new AjaxResult { Success = true }; SearchCriteriaModel filter = new SearchCriteriaModel(); filter.Category1ID = int.Parse(ConfigurationManager.AppSettings["ECCategoryID"]); NameValueCollection pageInfo = new NameValueCollection(); pageInfo.Add("pageIndex", pageIndex.ToString()); pageInfo.Add("pageSize", pageSize.ToString()); ProductSearchResultVM data = SearchManager.Search(filter, pageInfo); data.ProductList.CurrentPageData.ForEach(p => { p.ProductDefaultImage = ProductFacade.BuildProductImage(ImageSize.P240, p.ProductDefaultImage); }); result.Data = new { List = data.ProductList.CurrentPageData, PageCount = data.ProductList.TotalPages }; return(Json(result, JsonRequestBehavior.AllowGet)); }
public ActionResult Index() { ProductSearchResultVM pageVM = SearchManager.Search(new SearchCriteriaModel() { PageSize = 10 }, HttpContext.Request.QueryString); ViewBag.Title = HttpContext.Request.QueryString["keyword"]; return(View(pageVM)); }
public ActionResult AjaxBrandProducts(int ID) { SearchCriteriaModel criteria = new SearchCriteriaModel() { BrandID = ID, PageSize = 6 }; ProductSearchResultVM pageVM = SearchManager.Search(criteria, HttpContext.Request.QueryString); return(PartialView("_BrandProductList", pageVM)); }
public ActionResult AjaxSearchProducts() { ProductSearchResultVM pageVM = SearchManager.Search(new SearchCriteriaModel() { PageSize = 10 }, HttpContext.Request.QueryString); ViewBag.Title = HttpContext.Request.QueryString["keyword"]; return(PartialView("~/Views/UserControl/_SearchProductList.cshtml", pageVM)); }
/// <summary> /// 三级分类商品 /// </summary> /// <param name="ID"></param> /// <returns></returns> public ActionResult AjaxCategory3Products(int ID) { SearchCriteriaModel criteria = new SearchCriteriaModel() { Category3ID = ID, PageSize = 10 }; ProductSearchResultVM pageVM = SearchManager.Search(criteria, HttpContext.Request.QueryString); ViewBag.ID = ID; return(PartialView("~/Views/UserControl/_SearchProductList.cshtml", pageVM)); }
public ActionResult BrandDetail(int ID) { SearchCriteriaModel criteria = new SearchCriteriaModel() { BrandID = ID, PageSize = 6 }; ProductSearchResultVM pageVM = SearchManager.Search(criteria, HttpContext.Request.QueryString); var allBrands = ProductFacade.GetAllBrands(); var brandInfo = allBrands.Find(f => f.SysNo == ID); if (brandInfo != null) { ViewBag.Title = string.Format("{0}({1})", brandInfo.BrandName_Ch, brandInfo.BrandName_En); } ViewBag.ID = ID; return(View(pageVM)); }
/// <summary> /// 三级分类-详情 /// </summary> /// <param name="ID"></param> /// <returns></returns> public ActionResult Category3(int ID) { SearchCriteriaModel criteria = new SearchCriteriaModel() { Category3ID = ID, PageSize = 10 }; ProductSearchResultVM pageVM = SearchManager.Search(criteria, HttpContext.Request.QueryString); var allCategories = CategoryFacade.QueryCategoryInfos(); var subCategoryInfo = allCategories.Find(f => f.CategoryType == CategoryType.SubCategory && f.CategoryID == ID); if (subCategoryInfo != null) { ViewBag.Title = subCategoryInfo.CategoryName; } ViewBag.ID = ID; return(View(pageVM)); }