private void createTourneyButton_Click(object sender, EventArgs e)
        {
            SetTourneyInfo sti    = new SetTourneyInfo();
            DialogResult   result = sti.ShowDialog();

            if (result == DialogResult.Cancel)
            {
                return;
            }
            string tourneyName   = NiniUtilities.getStringValue(Constants.getRootTourneyInformationFile(), Constants.TourneyNameFieldName);
            string oldFolderName = Constants.CurrentTourneyFolderName;

            Constants.CurrentTourneyFolderName = Constants.generateTourneyFolder(tourneyName);
            if (tourneyExists(Constants.CurrentTourneyFolderName))
            {
                if (MessageBox.Show("Tourney already exists! Do you want to erase all existing contents?" + Environment.NewLine + "If you want to load an already existing tourney click NO and select your tourney from drop down list and click Load Existing Tourney Button.", "Tourney Already Exists!", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
                {
                    Constants.CurrentTourneyFolderName = oldFolderName;
                    return;
                }
                Directory.Delete(Constants.getCurrentTourneyFolder(), true);
            }
            File.Copy(Constants.getRootTourneyInformationFile(), Constants.getCurrentTourneyInformationFileName(), true);
            loadTourney(Constants.CurrentTourneyFolderName);
        }
 private void initialize()
 {
     this.Text          = NiniUtilities.getStringValue(Constants.getCurrentTourneyInformationFileName(), Constants.TourneyNameFieldName) + " : " + m_eventName;
     m_databaseFileName = Constants.getEventScoresFileName(m_eventName);
     Utilities.saveTabs(mainControlTab);
     Utilities.SetDataGridViewProperties(this);
     if (!File.Exists(m_databaseFileName))
     {
         createDatabases();
     }
     loadDatabases();
     if (!m_pdEventInfo.isValid())
     {
         Utilities.hideTabs(mainControlTab);
         List <string> tabNames = new List <string>();
         tabNames.Add("eventSetupTab");
         Utilities.showTabs(mainControlTab, tabNames);
         mainControlTab.SelectedTab = mainControlTab.TabPages["eventSetupTab"];
     }
     else
     {
         Utilities.showTabs(mainControlTab);
         mainControlTab.SelectedTab = mainControlTab.TabPages["namesTab"];
     }
     populateComboboxes();
     setComboboxesValues();
 }
Esempio n. 3
0
 private void initialize()
 {
     this.Text                   = NiniUtilities.getStringValue(Constants.getCurrentTourneyInformationFileName(), Constants.TourneyNameFieldName) + " : " + m_eventName;
     m_databaseFileName          = Constants.getEventScoresFileName(m_eventName);
     m_localWebpagesRoot         = Constants.getEventWebpagesFolder(m_eventName);
     m_resultsWebsite            = Constants.getEventResultsWebsite(m_eventName);
     websiteAddress_textBox.Text = m_resultsWebsite;
 }
Esempio n. 4
0
 private void initialize()
 {
     m_tourneyInfoFileName   = Constants.getCurrentTourneyInformationFileName();
     m_tourneyEventsFileName = Constants.getCurrentTourneyEventsFileName();
     m_tourneyName           = NiniUtilities.getStringValue(m_tourneyInfoFileName, Constants.TourneyNameFieldName);
     this.Text     = "Tourney Name : " + m_tourneyName;
     m_tourneyInfo = new TourneyInfo(Constants.getCurrentTourneyInformationFileName(), false);
     this.tourneyInfoPropertyGrid.SelectedObject = m_tourneyInfo;
     m_eventsTable = AccessDatabaseUtilities.loadDatabaseToTable(m_tourneyEventsFileName, Constants.TableName.TourneyEvents);
     loadEvents();
 }
        private void loadTourney(string selectedFolder)
        {
            Constants.CurrentTourneyFolderName = selectedFolder;
            loadTourneyInfo();
            loadTourneyEvents();
            Constants.CurrentTourneyName           = NiniUtilities.getStringValue(Constants.getCurrentTourneyInformationFileName(), Constants.TourneyNameFieldName);
            Constants.CurrentTourneyResultsWebsite = NiniUtilities.getStringValue(Constants.getCurrentTourneyInformationFileName(), Constants.ResultsWebsiteFieldName);
            EventManagement eventManagement = new EventManagement();

            this.Hide();
            eventManagement.ShowDialog();
            this.Close();
        }
Esempio n. 6
0
        private void saveTourneyInfoButton_Click(object sender, EventArgs e)
        {
            string newTourneyName = m_tourneyInfo.TourneyName;

            if (newTourneyName != m_tourneyName)
            {
                Utilities.showErrorMessage("Tourney Name can only be set when you create the tourney and cannot be editted now!" + Environment.NewLine + "Tourney Name will not be changed but any changes to the Results Website will be changed.");
                m_tourneyInfo.TourneyName = m_tourneyName;
                tourneyInfoPropertyGrid.Refresh();
            }
            m_tourneyInfo.save();
            Constants.CurrentTourneyName           = NiniUtilities.getStringValue(Constants.getCurrentTourneyInformationFileName(), Constants.TourneyNameFieldName);
            Constants.CurrentTourneyResultsWebsite = NiniUtilities.getStringValue(Constants.getCurrentTourneyInformationFileName(), Constants.ResultsWebsiteFieldName);
            Utilities.showBalloonNotification("Save Success", "Saved Tourney Info to Database");
        }
Esempio n. 7
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);
     }
 }
        public void load()
        {
            NiniUtilities.loadNiniConfig(m_niniFileName);
            numberOfTeams          = NiniUtilities.getIntValue(m_niniFileName, Constants.NumberOfTeamsFieldName);
            numberOfRounds         = NiniUtilities.getIntValue(m_niniFileName, Constants.NumberOfRoundsFieldName);
            numberOfBoardsPerRound = NiniUtilities.getIntValue(m_niniFileName, Constants.NumberOfBoardsFieldName);
            numberOfQualifiers     = NiniUtilities.getIntValue(m_niniFileName, Constants.NumberOfQualifiersFieldName);
            string vpScaleString = NiniUtilities.getStringValue(m_niniFileName, Constants.VPScaleFieldName, VPScaleOptions.BFI_30VP_Scale.ToString(), string.Join(",", Enum.GetNames(typeof(VPScaleOptions))));

            if (string.IsNullOrWhiteSpace(vpScaleString))
            {
                vpScale = VPScaleOptions.BFI_30VP_Scale;
            }
            else
            {
                vpScale = (VPScaleOptions)Enum.Parse(typeof(VPScaleOptions), vpScaleString, true);
            }
            previousNumberOfRounds = numberOfRounds;
            previousNumberOfTeams  = numberOfTeams;
        }
 public void load()
 {
     NiniUtilities.loadNiniConfig(m_niniFileName);
     scoringType      = (ScoringTypeValues)Enum.Parse(typeof(ScoringTypeValues), NiniUtilities.getStringValue(m_niniFileName, Constants.ScoringTypeFieldName), true);
     tiebreakerMethod = (TiebreakerMethodValues)Enum.Parse(typeof(TiebreakerMethodValues), NiniUtilities.getStringValue(m_niniFileName, Constants.TiebreakerMethodFieldName), true);
     byeScore         = NiniUtilities.getIntValue(m_niniFileName, Constants.ByeScoreFieldName, 18);
 }
 public void load()
 {
     NiniUtilities.loadNiniConfig(m_niniFileName);
     fontSize       = NiniUtilities.getDoubleValue(m_niniFileName, Constants.FontSizeFieldName);
     resultsWebsite = NiniUtilities.getStringValue(m_niniFileName, Constants.ResultsWebsiteFieldName);
 }
 public void load()
 {
     NiniUtilities.loadNiniConfig(m_niniFileName);
     tourneyName    = NiniUtilities.getStringValue(m_niniFileName, Constants.TourneyNameFieldName, "Unknown");
     resultsWebsite = NiniUtilities.getStringValue(m_niniFileName, Constants.ResultsWebsiteFieldName, "");
 }