/**
   * Sets the record to be edited in the dialog.
   *
   * @param order
   */
  public void setOrder(Order order) {
    this.order = order;

    timeOrderField.setText(order.getTime());
    employeeOrderField.setText(order.getEmployee());
    clientOrderField.setText(order.getClient());
    priceOrderField.setText(order.getPrice());
    paidOrderCheckBox.setSelected(order.isPaid());
  }
  /** Called when the user clicks ok. */
  @FXML
  private void handleOk() {
    if (isInputValid()) {
      order.setTime(timeOrderField.getText());
      order.setEmployee(employeeOrderField.getText());
      order.setClient(clientOrderField.getText());
      order.setPrice(priceOrderField.getText());
      order.setPaid(paidOrderCheckBox.isSelected());

      DBHelper.update(order);

      okClicked = true;
      dialogStage.close();
    }
  }