Beispiel #1
0
        /// <summary>
        /// 品牌列表
        /// </summary>
        /// <param name="brandName">品牌名称</param>
        /// <param name="sortColumn">排序列</param>
        /// <param name="sortDirection">排序方向</param>
        /// <param name="pageSize">每页数</param>
        /// <param name="pageNumber">当前页数</param>
        /// <returns></returns>
        public ActionResult List(string brandName, string sortColumn, string sortDirection, int pageSize = 15, int pageNumber = 1)
        {
            string condition = AdminBrands.AdminGetBrandListCondition(brandName);
            string sort      = AdminBrands.AdminGetBrandListSort(sortColumn, sortDirection);

            PageModel pageModel = new PageModel(pageSize, pageNumber, AdminBrands.AdminGetBrandCount(condition));

            BrandListModel model = new BrandListModel()
            {
                BrandList     = AdminBrands.AdminGetBrandList(pageModel.PageSize, pageModel.PageNumber, condition, sort),
                PageModel     = pageModel,
                SortColumn    = sortColumn,
                SortDirection = sortDirection,
                BrandName     = brandName
            };

            ShopUtils.SetAdminRefererCookie(string.Format("{0}?pageNumber={1}&pageSize={2}&sortColumn={3}&sortDirection={4}&brandName={5}",
                                                          Url.Action("list"),
                                                          pageModel.PageNumber,
                                                          pageModel.PageSize,
                                                          sortColumn,
                                                          sortDirection,
                                                          brandName));
            return(View(model));
        }
Beispiel #2
0
        /// <summary>
        /// 品牌列表
        /// </summary>
        /// <param name="brandName">品牌名称</param>
        /// <param name="pageSize">每页数</param>
        /// <param name="pageNumber">当前页数</param>
        /// <returns></returns>
        public ActionResult List(string brandName, int pageSize = 15, int pageNumber = 1)
        {
            string condition = AdminBrands.AdminGetBrandListCondition(brandName);

            PageModel pageModel = new PageModel(pageSize, pageNumber, AdminBrands.AdminGetBrandCount(condition));

            BrandListModel model = new BrandListModel()
            {
                PageModel = pageModel,
                BrandList = AdminBrands.AdminGetBrandList(pageModel.PageSize, pageModel.PageNumber, condition),
                BrandName = brandName
            };

            MallUtils.SetAdminRefererCookie(string.Format("{0}?pageNumber={1}&pageSize={2}&brandName={3}",
                                                          Url.Action("list"),
                                                          pageModel.PageNumber,
                                                          pageModel.PageSize,
                                                          brandName));
            return(View(model));
        }