/**
   * Päivittää käyttäjän syöttämät tiedot <code>DocumentTypeModel</code>ille.
   *
   * @return <code>true</code>, jos tietojen päivittäminen onnistui
   */
  public boolean updateModel() {
    int count = model.getDocumentTypeCount();
    DocumentType type;

    for (int i = 0; i < count; i++) {
      type = model.getDocumentType(i);

      if (type.getNumber() < 1) {
        SwingUtils.showErrorMessage(this, "Virheellinen numero.");
        return false;
      }

      if (type.getName().length() == 0) {
        SwingUtils.showErrorMessage(this, "Syötä tositelajin nimi ennen tallentamista.");
        return false;
      }

      if (type.getNumberStart() < 1) {
        SwingUtils.showErrorMessage(this, "Virheellinen tositenumerovälin alku.");
        return false;
      }

      if (type.getNumberEnd() < 1) {
        SwingUtils.showErrorMessage(this, "Virheellinen tositenumerovälin loppu.");
        return false;
      }
    }

    return true;
  }