public ActionResult WaterfallProductListData(string keyword, string type, int startIndex) { keyword = InjectionFilter.Filter(keyword); ProductCategory model = new ProductCategory(); ProductQuery query = new ProductQuery(); Maticsoft.BLL.SNS.Products products = new Maticsoft.BLL.SNS.Products(); query.Order = type; query.Keywords = keyword; query.CategoryID = -1; ((dynamic) base.ViewBag).BasePageSize = this._basePageSize; startIndex = (startIndex > 1) ? (startIndex + 1) : 0; int endIndex = (startIndex > 1) ? ((startIndex + this._waterfallDetailCount) - 1) : this._waterfallDetailCount; if (products.GetProductCount(query) < 1) { return new EmptyResult(); } model.ProductListWaterfall = products.GetProductByPage(query, startIndex, endIndex); string valueByCache = Maticsoft.BLL.SysManage.ConfigSystem.GetValueByCache("SNSIsStatic"); if ((model.ProductListWaterfall != null) && (model.ProductListWaterfall.Count > 0)) { foreach (Maticsoft.Model.SNS.Products products2 in model.ProductListWaterfall) { if (valueByCache != "true") { products2.StaticUrl = (string) ((((dynamic) base.ViewBag).BasePath + "Product/Detail/") + products2.ProductID); continue; } products2.StaticUrl = string.IsNullOrWhiteSpace(products2.StaticUrl) ? ((string) ((((dynamic) base.ViewBag).BasePath + "Product/Detail/") + products2.ProductID)) : products2.StaticUrl; } } return base.View("ProductListWaterfall", model); }
public PartialViewResult ProductList(int Cid = 0, int Top = 12, string ViewName = "ProductList") { ProductQuery query = new ProductQuery { CategoryID = new int?(Cid), IsTopCategory = true, Order = "popular" }; string valueByCache = Maticsoft.BLL.SysManage.ConfigSystem.GetValueByCache("HomeGetValueType"); if (valueByCache != null) { int num = 1; if (valueByCache == num.ToString()) { query.IsRecomend = 1; } } List<Maticsoft.Model.SNS.Products> model = this.ProductBll.GetProductByPage(query, 1, Top); if ((model != null) && (model.Count > 0)) { string str2 = Maticsoft.BLL.SysManage.ConfigSystem.GetValueByCache("SNSIsStatic"); foreach (Maticsoft.Model.SNS.Products products in model) { if (str2 != "true") { products.StaticUrl = (string) ((((dynamic) base.ViewBag).BasePath + "Product/Detail/") + products.ProductID); continue; } products.StaticUrl = string.IsNullOrWhiteSpace(products.StaticUrl) ? ((string) ((((dynamic) base.ViewBag).BasePath + "Product/Detail/") + products.ProductID)) : products.StaticUrl; } } return this.PartialView(ViewName, model); }
public ActionResult Product(int pageIndex = 1) { ((dynamic) base.ViewBag).Title = "商品搜索"; string inputString = string.IsNullOrWhiteSpace(base.Request.Params["keyword"]) ? "" : base.Server.UrlDecode(base.Request.Params["keyword"]); string str2 = string.IsNullOrWhiteSpace(base.Request.Params["type"]) ? "hot" : base.Request.Params["type"]; inputString = InjectionFilter.Filter(inputString); this.LogKeyWord(inputString); ProductCategory model = new ProductCategory(); Maticsoft.BLL.SNS.Products products = new Maticsoft.BLL.SNS.Products(); ProductQuery query = new ProductQuery { Order = str2 }; ((dynamic) base.ViewBag).sequence = str2; query.Keywords = inputString; query.CategoryID = -1; int pageSize = this._basePageSize + this._waterfallSize; ((dynamic) base.ViewBag).BasePageSize = this._basePageSize; int startIndex = (pageIndex > 1) ? (((pageIndex - 1) * pageSize) + 1) : 0; int endIndex = (pageIndex > 1) ? ((startIndex + this._basePageSize) - 1) : this._basePageSize; int productCount = 0; ((dynamic) base.ViewBag).CurrentPageAjaxStartIndex = endIndex; ((dynamic) base.ViewBag).CurrentPageAjaxEndIndex = pageIndex * pageSize; query.QueryType = 0; productCount = products.GetProductCount(query); if (productCount >= 1) { query.QueryType = 1; model.ProductPagedList = products.GetProductByPage(query, startIndex, endIndex).ToPagedList<Maticsoft.Model.SNS.Products>(pageIndex, pageSize, new int?(productCount)); string valueByCache = Maticsoft.BLL.SysManage.ConfigSystem.GetValueByCache("SNSIsStatic"); if ((model.ProductPagedList != null) && (model.ProductPagedList.Count > 0)) { foreach (Maticsoft.Model.SNS.Products products2 in model.ProductPagedList) { if (valueByCache != "true") { products2.StaticUrl = (string) ((((dynamic) base.ViewBag).BasePath + "Product/Detail/") + products2.ProductID); continue; } products2.StaticUrl = string.IsNullOrWhiteSpace(products2.StaticUrl) ? ((string) ((((dynamic) base.ViewBag).BasePath + "Product/Detail/") + products2.ProductID)) : products2.StaticUrl; } } if (base.Request.IsAjaxRequest()) { return this.PartialView("ProductList", model); } } return base.View(model); }
public PartialViewResult CategoryDetailPart(int topcid, string Name, int topcate = 5, int top = 12) { Maticsoft.BLL.SNS.Categories categories = new Maticsoft.BLL.SNS.Categories(); categories.GetMenuByCategory(-1); ProductCategory cateListByParentIdEx = categories.GetCateListByParentIdEx(topcid); cateListByParentIdEx.TagsList = this.TagTypeBll.GetTagListByCid(topcid, topcate); ProductQuery query = new ProductQuery { CategoryID = new int?(topcid), IsTopCategory = true, Order = "popular" }; string valueByCache = Maticsoft.BLL.SysManage.ConfigSystem.GetValueByCache("HomeGetValueType"); if (valueByCache != null) { int num = 1; if (valueByCache == num.ToString()) { query.IsRecomend = 1; } } cateListByParentIdEx.CurrentCateName = Name; return this.PartialView("CategoryDetailPart", cateListByParentIdEx); }