コード例 #1
0
  public String getBillIdValue() {
    /** */
    transactionList = new ArrayList<Myshopee_TransactionTO>();

    try {
      FacesContext context = FacesContext.getCurrentInstance();
      String paramValue =
          (String) context.getExternalContext().getRequestParameterMap().get("param");
      this.billId = Integer.parseInt(paramValue);

      transactionList = new Myshopee_Wrapper().getTransactionByBillId(this.billId);

      return "success";

    } catch (NoTransactionForThisBillException e) {
      ErrorLogger.logError(this.getClass().getName(), "getBillIdValue", e.getMessage());
      transactionList = null;
      this.setMessage(e.getMessage());
      return "fail";
    } catch (Exception e) {
      ErrorLogger.logError(this.getClass().getName(), "getBillIdValue", e.getMessage());
      transactionList = null;
      this.setMessage(e.getMessage());
      return "fail";
    }
  }
コード例 #2
0
  public String displayTransaction() {
    /** */
    if (this.fromDate.after(this.toDate)) {
      this.setMessage("To date must be after from date");
      return "fail";

    } else {
      try {
        billList = new ArrayList<Myshopee_BillingTO>();
        billList = new Myshopee_Wrapper().getTransaction(this.toDate, this.fromDate);

        return "dsuccess";
      } catch (NoBillingForThisRangeException e) {
        billList = null;
        this.setMessage(e.getMessage());
        return "fail";
      } catch (Exception e) {
        billList = null;
        ErrorLogger.logError(this.getClass().getName(), "displayTransaction", e.getMessage());
        this.setMessage(e.getMessage());
        return "fail";
      }
    }
  }