Beispiel #1
0
        //分页显示所有房屋板块信息
        protected void showSection()
        {
            int page = 1;

            if (!Int32.TryParse(Request["page"], out page))
            {
                page = 1;
            }

            int Record  = sectionService.GetRecordCount("");
            int maxpage = 0;

            if (Record % sectionService.pagesize == 0)
            {
                maxpage = Record / sectionService.pagesize;
            }
            else
            {
                maxpage = Record / sectionService.pagesize + 1;
            }
            if (page > maxpage)
            {
                page = maxpage;
            }
            sectionList = sectionService.FindSectionByPage("", "sid asc", page);

            pageCode = PageUtil.genPagination("/MyAdmin/SectionList.aspx", Record, page, sectionService.pagesize, "");   //分页

            //保存每个板块下房屋数
            foreach (Section section in sectionList)
            {
                section.housecount = houseService.GetRecordCount("sid= " + section.sid);
            }
        }