Esempio n. 1
0
 public ActionResult CountDown(int? pageIndex = 1, string viewName = "CountDown", string ajaxViewName = "_ProductList")
 {
     ProductListModel model = new ProductListModel();
     Maticsoft.Model.Shop.Products.CategoryInfo cateModel = null;
     int pageSize = this._basePageSize + this._waterfallSize;
     ((dynamic) base.ViewBag).BasePageSize = this._basePageSize;
     pageIndex = new int?((pageIndex.HasValue && (pageIndex.Value > 1)) ? pageIndex.Value : 1);
     int startIndex = (pageIndex.Value > 1) ? (((pageIndex.Value - 1) * pageSize) + 1) : 0;
     int endIndex = (pageIndex.Value > 1) ? ((startIndex + this._basePageSize) - 1) : this._basePageSize;
     int proSalesCount = this.productManage.GetProSalesCount();
     ((dynamic) base.ViewBag).CurrentPageAjaxStartIndex = endIndex;
     int? nullable = pageIndex;
     int num5 = pageSize;
     ((dynamic) base.ViewBag).CurrentPageAjaxEndIndex = nullable.HasValue ? new int?(nullable.GetValueOrDefault() * num5) : null;
     List<Maticsoft.Model.Shop.Products.ProductInfo> proSalesList = this.productManage.GetProSalesList(startIndex, endIndex);
     IPageSetting setting = PageSetting.GetCategorySetting(cateModel, "Category", ApplicationKeyType.Shop);
     ((dynamic) base.ViewBag).Title = setting.Title;
     ((dynamic) base.ViewBag).Keywords = setting.Keywords;
     ((dynamic) base.ViewBag).Description = setting.Description;
     if (proSalesCount >= 1)
     {
         int? nullable3 = pageIndex;
         model.ProductPagedList = proSalesList.ToPagedList<Maticsoft.Model.Shop.Products.ProductInfo>(nullable3.HasValue ? nullable3.GetValueOrDefault() : 1, pageSize, new int?(proSalesCount));
         if (base.Request.IsAjaxRequest())
         {
             return this.PartialView(ajaxViewName, model);
         }
     }
     return base.View(viewName, model);
 }
Esempio n. 2
0
 public ActionResult Index(int cid = 0, int brandid = 0, string keyword = "", string mod = "hot", string price = "0-0", int? pageIndex = 1, string viewName = "Index", string ajaxViewName = "_ProductList")
 {
     Func<Maticsoft.Model.Shop.Products.CategoryInfo, bool> predicate = null;
     ProductListModel model = new ProductListModel();
     keyword = InjectionFilter.SqlFilter(keyword);
     if (string.IsNullOrWhiteSpace(keyword))
     {
         return base.RedirectToAction("Index", "Home", new { Area = "" });
     }
     if (cid > 0)
     {
         List<Maticsoft.Model.Shop.Products.CategoryInfo> allCateList = Maticsoft.BLL.Shop.Products.CategoryInfo.GetAllCateList();
         if (predicate == null)
         {
             predicate = c => c.CategoryId == cid;
         }
         Maticsoft.Model.Shop.Products.CategoryInfo info = allCateList.FirstOrDefault<Maticsoft.Model.Shop.Products.CategoryInfo>(predicate);
         if (info != null)
         {
             string[] path_arr = info.Path.Split(new char[] { '|' });
             List<Maticsoft.Model.Shop.Products.CategoryInfo> list2 = (from c in allCateList
                 where path_arr.Contains<string>(c.CategoryId.ToString())
                 orderby c.Depth
                 select c).ToList<Maticsoft.Model.Shop.Products.CategoryInfo>();
             model.CategoryPathList = list2;
             model.CurrentCateName = info.Name;
         }
     }
     model.CurrentCid = cid;
     model.CurrentMod = mod;
     string str = "{";
     foreach (KeyValuePair<string, object> pair in base.Request.RequestContext.RouteData.Values)
     {
         object obj2 = str;
         str = string.Concat(new object[] { obj2, pair.Key, ":'", pair.Value, "'," });
     }
     str = str.TrimEnd(new char[] { ',' }) + "}";
     ((dynamic) base.ViewBag).DataParam = str;
     int pageSize = 15;
     pageIndex = new int?((pageIndex.HasValue && (pageIndex.Value > 1)) ? pageIndex.Value : 1);
     int startIndex = (pageIndex.Value > 1) ? (((pageIndex.Value - 1) * pageSize) + 1) : 0;
     int endIndex = (pageIndex.Value > 1) ? ((startIndex + pageSize) - 1) : pageSize;
     int num4 = this.productManage.GetSearchCountEx(cid, brandid, keyword, price);
     ((dynamic) base.ViewBag).TotalCount = num4;
     ((dynamic) base.ViewBag).CurrentPageAjaxStartIndex = endIndex;
     int? nullable = pageIndex;
     int num5 = pageSize;
     ((dynamic) base.ViewBag).CurrentPageAjaxEndIndex = nullable.HasValue ? new int?(nullable.GetValueOrDefault() * num5) : null;
     List<Maticsoft.Model.Shop.Products.ProductInfo> list3 = this.productManage.GetSearchListEx(cid, brandid, keyword, price, mod, startIndex, endIndex);
     if (num4 >= 1)
     {
         int? nullable3 = pageIndex;
         model.ProductPagedList = list3.ToPagedList<Maticsoft.Model.Shop.Products.ProductInfo>(nullable3.HasValue ? nullable3.GetValueOrDefault() : 1, pageSize, new int?(num4));
         if (base.Request.IsAjaxRequest())
         {
             return this.PartialView(ajaxViewName, model);
         }
     }
     return base.View(viewName, model);
 }
Esempio n. 3
0
 public ActionResult Index(int cid = 0, int brandid = 0, string attrvalues = "0", string mod = "hot", string price = "", int? pageIndex = 1, string viewName = "Index", string ajaxViewName = "_ProductList")
 {
     Func<Maticsoft.Model.Shop.Products.CategoryInfo, bool> predicate = null;
     ProductListModel model = new ProductListModel();
     Maticsoft.Model.Shop.Products.CategoryInfo cateModel = null;
     ((dynamic) base.ViewBag).ParentId = 0;
     if (cid > 0)
     {
         List<Maticsoft.Model.Shop.Products.CategoryInfo> allCateList = Maticsoft.BLL.Shop.Products.CategoryInfo.GetAllCateList();
         if (predicate == null)
         {
             predicate = c => c.CategoryId == cid;
         }
         cateModel = allCateList.FirstOrDefault<Maticsoft.Model.Shop.Products.CategoryInfo>(predicate);
         if (cateModel != null)
         {
             string[] path_arr = cateModel.Path.Split(new char[] { '|' });
             List<Maticsoft.Model.Shop.Products.CategoryInfo> list2 = (from c in allCateList
                 where path_arr.Contains<string>(c.CategoryId.ToString())
                 orderby c.Depth
                 select c).ToList<Maticsoft.Model.Shop.Products.CategoryInfo>();
             model.CategoryPathList = list2;
             model.CurrentCateName = cateModel.Name;
         }
         ((dynamic) base.ViewBag).ParentId = cateModel.ParentCategoryId;
     }
     model.CurrentCid = cid;
     model.CurrentMod = mod;
     string str = "{";
     foreach (KeyValuePair<string, object> pair in base.Request.RequestContext.RouteData.Values)
     {
         object obj2 = str;
         str = string.Concat(new object[] { obj2, pair.Key, ":'", pair.Value, "'," });
     }
     str = str.TrimEnd(new char[] { ',' }) + "}";
     ((dynamic) base.ViewBag).DataParam = str;
     int pageSize = 15;
     pageIndex = new int?((pageIndex.HasValue && (pageIndex.Value > 1)) ? pageIndex.Value : 1);
     int startIndex = (pageIndex.Value > 1) ? (((pageIndex.Value - 1) * pageSize) + 1) : 0;
     int endIndex = (pageIndex.Value > 1) ? ((startIndex + pageSize) - 1) : pageSize;
     int num4 = this.productManage.GetProductsCountEx(cid, brandid, attrvalues, price);
     ((dynamic) base.ViewBag).CurrentPageAjaxStartIndex = endIndex;
     int? nullable = pageIndex;
     int num5 = pageSize;
     ((dynamic) base.ViewBag).CurrentPageAjaxEndIndex = nullable.HasValue ? new int?(nullable.GetValueOrDefault() * num5) : null;
     List<Maticsoft.Model.Shop.Products.ProductInfo> list3 = this.productManage.GetProductsListEx(cid, brandid, attrvalues, price, mod, startIndex, endIndex);
     IPageSetting setting = PageSetting.GetCategorySetting(cateModel, "Category", ApplicationKeyType.Shop);
     ((dynamic) base.ViewBag).Title = setting.Title;
     ((dynamic) base.ViewBag).Keywords = setting.Keywords;
     ((dynamic) base.ViewBag).Description = setting.Description;
     if (num4 >= 1)
     {
         int? nullable3 = pageIndex;
         model.ProductPagedList = list3.ToPagedList<Maticsoft.Model.Shop.Products.ProductInfo>(nullable3.HasValue ? nullable3.GetValueOrDefault() : 1, pageSize, new int?(num4));
         if (base.Request.IsAjaxRequest())
         {
             return this.PartialView(ajaxViewName, model);
         }
     }
     return base.View(viewName, model);
 }
Esempio n. 4
0
 public ActionResult Index(int cid = 0, int brandid = 0, string keyword = "", string mod = "default", string price = "0-0", int? pageIndex = 1, string viewName = "Index", string ajaxViewName = "_ProductList")
 {
     Func<Maticsoft.Model.Shop.Products.CategoryInfo, bool> predicate = null;
     ProductListModel model = new ProductListModel();
     keyword = InjectionFilter.SqlFilter(keyword);
     if (string.IsNullOrWhiteSpace(keyword))
     {
         return base.RedirectToAction("Index", "Home");
     }
     if (cid > 0)
     {
         Func<Maticsoft.Model.Shop.Products.CategoryInfo, bool> func = null;
         List<Maticsoft.Model.Shop.Products.CategoryInfo> allCateList = Maticsoft.BLL.Shop.Products.CategoryInfo.GetAllCateList();
         if (predicate == null)
         {
             predicate = c => c.CategoryId == cid;
         }
         Maticsoft.Model.Shop.Products.CategoryInfo categoryInfo = allCateList.FirstOrDefault<Maticsoft.Model.Shop.Products.CategoryInfo>(predicate);
         if (categoryInfo != null)
         {
             if (func == null)
             {
                 func = delegate (Maticsoft.Model.Shop.Products.CategoryInfo c) {
                     if (!categoryInfo.Path.Contains(c.Path + "|"))
                     {
                         return c.Path == categoryInfo.Path;
                     }
                     return true;
                 };
             }
             List<Maticsoft.Model.Shop.Products.CategoryInfo> list2 = allCateList.Where<Maticsoft.Model.Shop.Products.CategoryInfo>(func).ToList<Maticsoft.Model.Shop.Products.CategoryInfo>();
             model.CategoryPathList = list2;
         }
     }
     model.CurrentCid = cid;
     model.CurrentMod = mod;
     string str = "{";
     foreach (KeyValuePair<string, object> pair in base.Request.RequestContext.RouteData.Values)
     {
         object obj2 = str;
         str = string.Concat(new object[] { obj2, pair.Key, ":'", pair.Value, "'," });
     }
     str = str.TrimEnd(new char[] { ',' }) + "}";
     ((dynamic) base.ViewBag).DataParam = str;
     int pageSize = this._basePageSize + this._waterfallSize;
     ((dynamic) base.ViewBag).BasePageSize = this._basePageSize;
     pageIndex = new int?((pageIndex.HasValue && (pageIndex.Value > 1)) ? pageIndex.Value : 1);
     int startIndex = (pageIndex.Value > 1) ? (((pageIndex.Value - 1) * pageSize) + 1) : 0;
     int endIndex = (pageIndex.Value > 1) ? ((startIndex + this._basePageSize) - 1) : this._basePageSize;
     int num4 = this.productManage.GetSearchCountEx(cid, brandid, keyword, price);
     ((dynamic) base.ViewBag).TotalCount = num4;
     ((dynamic) base.ViewBag).CurrentPageAjaxStartIndex = endIndex;
     int? nullable = pageIndex;
     int num5 = pageSize;
     ((dynamic) base.ViewBag).CurrentPageAjaxEndIndex = nullable.HasValue ? new int?(nullable.GetValueOrDefault() * num5) : null;
     List<Maticsoft.Model.Shop.Products.ProductInfo> list3 = this.productManage.GetSearchListEx(cid, brandid, keyword, price, mod, startIndex, endIndex);
     IPageSetting pageSetting = PageSetting.GetPageSetting("Category", ApplicationKeyType.Shop);
     pageSetting.Replace(new string[][] { new string[] { "{cname}", model.CurrentCateName } });
     ((dynamic) base.ViewBag).Title = pageSetting.Title;
     ((dynamic) base.ViewBag).Keywords = pageSetting.Keywords;
     ((dynamic) base.ViewBag).Description = pageSetting.Description;
     if (num4 >= 1)
     {
         int? nullable3 = pageIndex;
         model.ProductPagedList = list3.ToPagedList<Maticsoft.Model.Shop.Products.ProductInfo>(nullable3.HasValue ? nullable3.GetValueOrDefault() : 1, pageSize, new int?(num4));
         if (base.Request.IsAjaxRequest())
         {
             return this.PartialView(ajaxViewName, model);
         }
     }
     return base.View(viewName, model);
 }