Пример #1
0
 // 条件查询
 private void termQuery(int currentPage) {
   TOrder torder = new TOrder();
   torder.setOrderID(orderNum.getText().getText().trim());
   TUser tuser = new TUser();
   tuser.setUserID(userNum.getText().getText().trim());
   torder.setTUser(tuser);
   torder.setOperator(seller.getText().getText().trim());
   torder.setHappenTime(startTime.getDate());
   torder.setEndTime(endTime.getDate());
   tableJsp.getViewport().remove(table);
   tableJsp.getViewport().add(waitComponent);
   try {
     pageView.setCurrentPage(currentPage);
     PageModel<TOrder> pageModel =
         orderService.getScrollService(pageView.getFirstResult(), pageView.getMaxResult(), torder);
     pageView.setPageModel(pageModel);
     pageView.setPageIndex(
         PageIndex.getPageIndex(
             pageView.getPageCode(), pageView.getCurrentPage(), pageView.getTotalPage()));
     if (pageModel != null) {
       tableJsp.getViewport().remove(waitComponent);
       tableJsp.getViewport().add(table);
       orderOnlineModel.setRowData(pageModel.getResultList());
       table.updateUI();
       pagingComponent.show();
     } else {
       // 没有订单数据
       waitComponent.setText("不存在数据");
     }
   } catch (Exception e) {
     e.printStackTrace();
   }
 }
 @Override
 public void keyReleased(KeyEvent e) {
   if (e.getSource() == fillMoneyTF.getText()) {
     if (e.getKeyCode() == KeyEvent.VK_ENTER) {
       TShopCharge tShopCharge = new TShopCharge();
       tShopCharge.setAMount(Double.parseDouble(fillMoneyTF.getText().getText()));
       try {
         PageModel<TShopCharge> pageModel =
             tShopChargeService.getTShopChargeService(0, 2, tShopCharge);
         if (pageModel != null) {
           giftMoneyTF.getText().setText(pageModel.getResultList().get(0).getGiftAmount() + "");
         } else {
           giftMoneyTF.getText().setText(0 + "");
         }
       } catch (Exception e1) {
         // TODO Auto-generated catch block
         e1.printStackTrace();
       }
     }
   }
 }