private void createKnockoutEvent(int tabNumber)
        {
            m_currentTabNumber = tabNumber;
            TextBox tb         = this.Controls.Find("eventNameTextbox_" + tabNumber, true)[0] as TextBox;
            string  eventName  = tb.Text;
            string  rootFolder = Path.Combine(Constants.getCurrentTourneyDatabasesFolder(), Utilities.makeIdentifier_(eventName));

            if (Directory.Exists(rootFolder))
            {
                DialogResult result = MessageBox.Show("An event already exists at " + rootFolder + ". Do you want to overwrite all contents?", "Event Exists!", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
                if (result == DialogResult.No)
                {
                    return;
                }
                Directory.Delete(rootFolder, true);
                Directory.Delete(Path.Combine(Constants.getCurrentTourneyWebpagesFolder(), Utilities.makeIdentifier_(eventName)), true);
            }
            if (!addEvent(eventName, Constants.EventType.TeamsKnockout))
            {
                return;
            }
            m_databaseFileName = Constants.getKnockoutEventScoresFileName(eventName);
            KnockoutSessions knockoutSessions = new KnockoutSessions(eventName, Constants.getKnockoutEventInfoFileName(eventName),
                                                                     Constants.getKnockoutEventScoresFileName(eventName), true);

            knockoutSessions.NumberOfTeams = m_qualifiersPerEvent;
            populateKnockoutTables();
            knockoutSessions.initializeMatches();
        }
Beispiel #2
0
 private void initialize()
 {
     this.Text = NiniUtilities.getStringValue(Constants.getCurrentTourneyInformationFileName(), Constants.TourneyNameFieldName) + " : " + m_eventName;
     Utilities.SetDataGridViewProperties(this);
     m_knockoutSessions = new KnockoutSessions(eventSetupPropertyGrid, m_eventName, m_niniFileName, m_databaseFileName, true);
     knockoutSessionsDataGridView.DataSource = AccessDatabaseUtilities.getDataTable(m_databaseFileName, Constants.TableName.KnockoutSessions);
     knockoutNamesDataGridView.DataSource    = AccessDatabaseUtilities.getDataTable(m_databaseFileName, Constants.TableName.KnockoutTeams);
     populateKnockoutRounds();
     m_resultsPublishParameters = new ResultsPublishParameters(m_eventName, Constants.getResultsPublishParametersFileName(m_eventName), true);
     resultsPublishPropertyGrid.SelectedObject = m_resultsPublishParameters;
     if (string.IsNullOrWhiteSpace(m_resultsPublishParameters.ResultsWebsite))
     {
         m_resultsPublishParameters.ResultsWebsite = Constants.getEventResultsWebsite(m_eventName);
     }
 }