예제 #1
0
  /** Moves the controller into the WaitingForPhoneNumber state. */
  private void gotoDisplayingOrderConfirmation() {

    this.currentState = NewOrderContState.CSDisplayingOrderConfirmation;

    // Disallow modifying and deleting of the list.
    view.setChannelEnabled(NewOrderInChan.ICCustomerName, false);
    view.setChannelEnabled(NewOrderInChan.ICCustomerAddress, false);

    view.setChannelEnabled(NewOrderInChan.ICListDelete, false);
    view.setChannelEnabled(NewOrderInChan.ICListModify, false);
    view.setChannelEnabled(NewOrderInChan.ICMenuOption, false);
    view.setChannelEnabled(NewOrderInChan.ICBack, false);

    // Show a "continue" option.
    view.setChannelEnabled(NewOrderInChan.ICConfirm, true);

    // Display the customer and the list.
    view.displayObject(_currentOrder.getCustomer(), NewOrderOutChan.OCCustomerDisplay);
    view.displayList(_currentOrder.getFoodItems(), NewOrderOutChan.OCFoodItemList);

    view.displayString(
        "$" + Order.formatPrice(_currentOrder.calculateSubtotal()),
        NewOrderOutChan.OCSubTotalDisplay);
    view.displayString(
        "$" + Order.formatPrice(_currentOrder.getTax()), NewOrderOutChan.OCTaxDisplay);
    view.displayString(
        "$" + Order.formatPrice(_currentOrder.calculateTotal()), NewOrderOutChan.OCTotalDisplay);

    view.displayString(
        "" + Time.formatTime(_currentOrder.calculateEstimatedDeliveryTime()),
        NewOrderOutChan.OCDeliveryTimeDisplay);
  }
예제 #2
0
  /** Moves the controller into the WaitingForPhoneNumber state. */
  private void gotoDisplayingOrder() {

    this.currentState = NewOrderContState.CSDisplayingOrder;

    // Disable the back button if we're modifying.
    if (_modifying) {
      view.setChannelEnabled(NewOrderInChan.ICBack, false);
    }

    // Disable the customer info channels.
    view.setChannelEnabled(NewOrderInChan.ICCustomerName, false);
    view.setChannelEnabled(NewOrderInChan.ICCustomerAddress, false);

    // Enable the other channels.
    view.setChannelEnabled(NewOrderInChan.ICListDelete, true);
    view.setChannelEnabled(NewOrderInChan.ICListModify, true);
    view.setChannelEnabled(NewOrderInChan.ICMenuOption, true);

    // Update the fooditem list in the order.
    updateOrderFoodItemList();

    // Display the customer and the list.
    view.displayObject(_currentOrder.getCustomer(), NewOrderOutChan.OCCustomerDisplay);
    view.displayList(_currentOrder.getFoodItems(), NewOrderOutChan.OCFoodItemList);

    view.displayString(
        "$" + Order.formatPrice(_currentOrder.calculateSubtotal()),
        NewOrderOutChan.OCSubTotalDisplay);
    view.displayString(
        "$" + Order.formatPrice(_currentOrder.getTax()), NewOrderOutChan.OCTaxDisplay);
    view.displayString(
        "$" + Order.formatPrice(_currentOrder.calculateTotal()), NewOrderOutChan.OCTotalDisplay);
  }