示例#1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //输出所有的信息
            BLL.HKSJ_Main mainService = new BLL.HKSJ_Main();
            //mainShowo = mainService.GetModelList(string.Empty);


            //分页每页显示13个记录
            int pageIndex = Request["pageIndex"] == null ? 1 : Convert.ToInt32(Request["pageIndex"]);
            int pageSize  = Request["pageSize"] == null ? 13 : Convert.ToInt32(Request["pageSize"]);

            //获取总数totalCount
            int totalCount = mainService.GetRecordCount(string.Empty);

            DataSet ds = mainService.GetListByPage(string.Empty, "ID", pageSize * (pageIndex - 1) + 1, pageSize * pageIndex);

            mainShowo = mainService.DataTableToList(ds.Tables[0]);

            NavPager = Common.LaomaPager.ShowPageNavigate(pageSize, pageIndex, totalCount);
        }
示例#2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //获取网站Main表中的数据
            BLL.HKSJ_Main mainServices = new BLL.HKSJ_Main();
            // mainShow = mainServices.GetModelList(string.Empty);

            //首先获取分页参数
            int pageSize  = Request["pageSize"] == null ? 10 : Convert.ToInt32(Request["pageSize"]);
            int pageIndex = Request["pageIndex"] == null ? 1 : Convert.ToInt32(Request["pageIndex"]);

            //获取到totalCount的数据
            int totalCount = mainServices.GetRecordCount(string.Empty);

            //计算在页面上面显示的分页的数量
            DataSet ds = mainServices.GetListByPage(string.Empty, "ID", pageSize * (pageIndex - 1) + 1, pageIndex * pageSize);

            mainShow = mainServices.DataTableToList(ds.Tables[0]);

            NavPager = Common.LaomaPager.ShowPageNavigate(pageSize, pageIndex, totalCount);
        }