Beispiel #1
0
        /// <summary>
        /// 禁止IP列表
        /// </summary>
        /// <param name="ip">ip</param>
        /// <param name="pageSize">每页数</param>
        /// <param name="pageNumber">当前页数</param>
        /// <returns></returns>
        public ActionResult List(string ip, int pageSize = 15, int pageNumber = 1)
        {
            PageModel pageModel = new PageModel(pageSize, pageNumber, AdminBannedIPs.AdminGetBannedIPCount(ip));

            BannedIPListModel model = new BannedIPListModel()
            {
                PageModel    = pageModel,
                BannedIPList = AdminBannedIPs.AdminGetBannedIPList(pageModel.PageSize, pageModel.PageNumber, ip),
                IP           = ip
            };

            ShopUtils.SetAdminRefererCookie(string.Format("{0}?pageNumber={1}&pageSize={2}&ip={3}",
                                                          Url.Action("list"),
                                                          pageModel.PageNumber,
                                                          pageModel.PageSize,
                                                          ip));
            return(View(model));
        }
        /// <summary>
        /// 禁止IP列表
        /// </summary>
        /// <param name="ip">ip</param>
        /// <param name="sortOptions">排序</param>
        /// <param name="pageSize">每页数</param>
        /// <param name="pageNumber">当前页数</param>
        /// <returns></returns>
        public ActionResult List(string ip, string sortColumn, string sortDirection, int pageSize = 15, int pageNumber = 1)
        {
            string    sort      = AdminBannedIPs.AdminGetBannedIPListSort(sortColumn, sortDirection);
            PageModel pageModel = new PageModel(pageSize, pageNumber, AdminBannedIPs.AdminGetBannedIPCount(ip));

            BannedIPListModel model = new BannedIPListModel()
            {
                BannedIPList  = AdminBannedIPs.AdminGetBannedIPList(pageModel.PageSize, pageModel.PageNumber, ip, sort),
                PageModel     = pageModel,
                SortColumn    = sortColumn,
                SortDirection = sortDirection,
                IP            = ip
            };

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