コード例 #1
0
  @FXML
  private void saveNewMatch() throws RemoteException {

    if (validateInput()) {

      MatchDTO newMatch = new MatchDTOImpl();
      newMatch.setDuration(_duration);
      Calendar cal = new GregorianCalendar();
      cal.set(
          _localDate.getYear(),
          _localDate.getMonthValue(),
          _localDate.getDayOfMonth(),
          _localTime.getHour(),
          _localTime.getMinute(),
          _localTime.getSecond());
      newMatch.setStart(cal.getTime());

      MatchDTOImpl.SimpleMatchTeamDTO team1 =
          new MatchDTOImpl.SimpleMatchTeamDTO(
              _allTeamsTableView.getSelectionModel().getSelectedItem().getId());
      team1.setId(_allTeamsOpponentTableView.getSelectionModel().getSelectedItem().getId());
      team1.setName(_allTeamsTableView.getSelectionModel().getSelectedItem().getName());
      team1.setVersion(_allTeamsTableView.getSelectionModel().getSelectedItem().getVersion());

      MatchDTOImpl.SimpleMatchTeamDTO team2 =
          new MatchDTOImpl.SimpleMatchTeamDTO(
              _allTeamsOpponentTableView.getSelectionModel().getSelectedItem().getId());
      team2.setId(_allTeamsOpponentTableView.getSelectionModel().getSelectedItem().getId());
      team2.setName(_allTeamsOpponentTableView.getSelectionModel().getSelectedItem().getName());
      team2.setVersion(
          _allTeamsOpponentTableView.getSelectionModel().getSelectedItem().getVersion());

      newMatch.setTeam1(team1);
      newMatch.setTeam2(team2);
      newMatch.setTournamentId(_tournament.getId());
      newMatch.setMatchStatus("Planned");

      _tournament.addMatch(newMatch);

      initSuccessAlert();
      // todo fix correct weiterleitung
      if (_newTournament) {
        SportifyGUI.getSharedMainApp().loadNewTournamentView(_tournament, _externalDisplayTeamDTOs);
      } else {
        SportifyGUI.getSharedMainApp().loadEditTournamentForm(_tournament);
      }
    }
  }
コード例 #2
0
 private void loadSearchMemberForm() {
   SportifyGUI.getSharedMainApp().loadSearchMemberForm();
 }
コード例 #3
0
 private void loadMemberDataView(PersonDTO person, BorderPane pane) {
   SportifyGUI.getSharedMainApp().loadMemberDataView(person, pane);
 }
コード例 #4
0
 @FXML
 private void cancelNewMatch() {
   SportifyGUI.getSharedMainApp().loadNewTournamentView(_tournament, _externalDisplayTeamDTOs);
 }