Пример #1
0
 /** 分页查询 */
 public String list() throws Exception {
   PagerUtil<ApInvoiceView> pagerUtil = new PagerUtil<ApInvoiceView>();
   apInvoicePage = pagerUtil.getRequestPage();
   apInvoicePage.setPageSize(10);
   Map m = Tools.buildMap(Struts2Util.getRequest());
   List<ApInvoiceView> invoiceList = null;
   long total = 0;
   try {
     invoiceList = apInvoiceDao.list(apInvoicePage, m);
     total = this.apInvoiceDao.getTotalPage(m);
   } catch (Exception e) {
     e.printStackTrace();
   }
   apInvoicePage.setTotalCount(total);
   apInvoicePage.setResult(invoiceList);
   Struts2Util.getRequest().setAttribute("pagerInfo", apInvoicePage);
   Struts2Util.getRequest().setAttribute("params", m);
   return "success";
 }
Пример #2
0
  /** 进入invoice_list页面 */
  @Override
  public String input() {
    // TODO Auto-generated method stub
    PagerUtil<ApInvoiceView> pagerUtil = new PagerUtil<ApInvoiceView>();
    apInvoicePage = pagerUtil.getRequestPage();
    apInvoicePage.setPageSize(10);
    List<ApInvoiceView> invoiceList = null;
    long total = 0;
    try {
      invoiceList = apInvoiceDao.list(apInvoicePage, null);
      total = this.apInvoiceDao.getTotalPage(null);
    } catch (Exception e) {
      e.printStackTrace();
    }
    apInvoicePage.setTotalCount(total);
    apInvoicePage.setResult(invoiceList);

    //		ApInvoiceLine a = this.apInvoiceLineDao.get(1);

    Struts2Util.getRequest().setAttribute("pagerInfo", apInvoicePage);

    return "enter";
  }