protected void show(object sender, EventArgs e) { int pageNumber = 1; if (!Int32.TryParse(Request["page"], out pageNumber)) { pageNumber = 1; } int maxPage = 0; int recordCount = smallclassService.GetRecordCount(""); if (recordCount % smallclassService.pageCount == 0) { maxPage = recordCount / smallclassService.pageCount; } else { maxPage = recordCount / smallclassService.pageCount + 1; } smallclassList = smallclassService.FindAllSmall(pageNumber); BigClass bigclass = new BigClass(); bigclassList = bigclassService.GetModelList(""); foreach (SmallClass smallclass in smallclassList) { smallclass.BigClassName = bigclassService.GetModel(smallclass.bigid).bigname; } pageCode = PageUtil.genPagination("/admin/SmallManger.aspx", recordCount, pageNumber, smallclassService.pageCount, ""); }
protected void Page_Load(object sender, EventArgs e) { //占位标签 SearchBigId = Int32.Parse(Request["SearchBigId"]); BigClassService bigclassService = new BigClassService(); BigClass bigClass = new BigClass(); bigClass = bigclassService.GetModel(SearchBigId); nav = bigClass.bigname; SearchSmallId = Int32.Parse(Request["SearchSmallId"]); if (SearchSmallId > 0) { SmallClassService smallclassService = new SmallClassService(); SmallClass smallClass = new SmallClass(); smallClass = smallclassService.GetModel(SearchSmallId); Code = smallClass.smallname; NoticeService noticeService = new NoticeService(); NoticeList = noticeService.GetModelList(""); //分页 int pageNumber = 1; if (!Int32.TryParse(Request["page"], out pageNumber)) { pageNumber = 1; } GoodsService goodsService = new GoodsService(); //goodsList = goodsService.GetModelList("smallid=" +SearchSmallId); int maxPage = 0; int recordCount = goodsService.GetRecordCount("smallid=" + SearchSmallId); if (recordCount % goodsService.pageCount == 0) { maxPage = recordCount / goodsService.pageCount; } else { maxPage = recordCount / goodsService.pageCount + 1; } if (pageNumber > maxPage) { pageNumber = maxPage; } goodsList = goodsService.FindAllGoodsList(pageNumber, "smallid=" + SearchSmallId); pageCode = PageUtil.genPagination("/goods/GoodsList.aspx", recordCount, pageNumber, goodsService.pageCount, "SearchSmallId=" + SearchSmallId.ToString() + "&SearchBigId=" + SearchBigId); } else { } }