示例#1
0
  public String newnews() {
    HttpServletRequest request = getRequest();
    String pageIndex = request.getParameter("page");
    int pageSize = 10;
    PageInfo pageInfo = createPageInfo();
    pageInfo.setPageSize(pageSize);
    if (pageIndex == null) {
      pageInfo.setPageIndex(1);
    } else {
      pageInfo.setPageIndex(Integer.parseInt(pageIndex));
    }
    this.goodList = this.goodService.select(new Good());

    this.advertiseList = this.advertiseService.getAdvertiseList();
    Information inf = new Information();
    inf.setType("0");
    this.inforAllList = this.informationService.pageList(pageInfo, inf, true);
    if ((pageInfo.getCount() > 0) && (pageInfo.getCount() % pageSize != 0)) {
      pageInfo.setPageCount(pageInfo.getCount() / pageSize + 1);
    } else {
      pageInfo.setPageCount(pageInfo.getCount() / pageSize);
    }
    request.setAttribute("pageInfo", pageInfo);

    this.informationList = this.informationService.select(new Information());
    return "newnews";
  }
示例#2
0
  public String getNewsdetail() {
    if (this.information == null) {
      this.information = new Information();
    }
    this.information = ((Information) this.informationService.selectOne(this.information));
    Information infor = new Information();
    infor.setType(this.information.getType());
    this.inforAllList = this.informationService.select(infor);
    for (int i = 0; i < this.inforAllList.size(); i++) {
      if (this.information.getId().equals(((Information) this.inforAllList.get(i)).getId())) {
        this.inforAllList.remove(i);
      }
    }
    this.informationList = this.informationService.select(new Information());
    this.advertiseList = this.advertiseService.getAdvertiseList();

    return "news_detail";
  }