コード例 #1
0
  private String buildTransaction() {
    String transaction = "";
    DateFormat dateFormat;

    for (Item i : order.getOrder()) {
      dateFormat = new SimpleDateFormat("YYMMddHHmmss");
      transaction += dateFormat.format(this.transDate) + ", ";
      transaction +=
          i.getBook().getId() + ", " + i.getBook().getTitle() + ", " + i.getBook().getPriceStr();
      transaction +=
          ", " + i.getQuantity() + ", " + i.getPercentStr() + ", " + i.getTotalStr() + ", ";
      dateFormat = new SimpleDateFormat("dd/MM/YY HH:mm:ss z");
      transaction += dateFormat.format(this.transDate) + newLine;
    }
    return transaction;
  }
コード例 #2
0
  public void confirmItem() {
    this.subtotal += item.getTotal();
    String subtotalStr = formatter.format(this.subtotal);
    text_bookID.setText("");
    text_quantity.setText("");
    text_subtotal.setText(subtotalStr);

    confirmAlert();

    order.addItem(item);
    this.totalQuantity += item.getQuantity();
    changeItemNumber();
    btn_confirm.setDisable(true);
    btn_view.setDisable(false);
    text_totalItems.setDisable(true);
    item = null;
  }