private void TrickScorebook_Load(object sender, EventArgs e)
        {
            if (Properties.Settings.Default.TrickScorebook_Width > 0)
            {
                this.Width = Properties.Settings.Default.TrickScorebook_Width;
            }
            if (Properties.Settings.Default.TrickScorebook_Height > 0)
            {
                this.Height = Properties.Settings.Default.TrickScorebook_Height;
            }
            if (Properties.Settings.Default.TrickScorebook_Location.X > 0 &&
                Properties.Settings.Default.TrickScorebook_Location.Y > 0)
            {
                this.Location = Properties.Settings.Default.TrickScorebook_Location;
            }
            myTourProperties        = TourProperties.Instance;
            bestScoreButton.Checked = true;
            if (myTourProperties.TrickScorebookDataType.ToLower().Equals("total"))
            {
                totalScoreButton.Checked = true;
            }
            if (myTourProperties.TrickScorebookDataType.ToLower().Equals("final"))
            {
                finalScoreButton.Checked = true;
            }
            if (myTourProperties.TrickScorebookDataType.ToLower().Equals("first"))
            {
                firstScoreButton.Checked = true;
            }
            nopsPointsButton.Checked = true;
            if (myTourProperties.TrickScorebookPointsMethod.ToLower().Equals("nops"))
            {
                nopsPointsButton.Checked = true;
            }
            if (myTourProperties.TrickScorebookPointsMethod.ToLower().Equals("plcmt"))
            {
                plcmtPointsButton.Checked = true;
            }
            if (myTourProperties.TrickScorebookPointsMethod.ToLower().Equals("kbase"))
            {
                kBasePointsButton.Checked = true;
            }
            if (myTourProperties.TrickScorebookPointsMethod.ToLower().Equals("ratio"))
            {
                ratioPointsButton.Checked = true;
            }

            plcmtDivButton.Checked = true;
            if (myTourProperties.TrickScorebookPlcmtOrg.ToLower().Equals("div"))
            {
                plcmtDivButton.Checked = true;
            }
            if (myTourProperties.TrickScorebookPlcmtOrg.ToLower().Equals("divgr"))
            {
                plcmtDivGrpButton.Checked = true;
            }

            // Retrieve data from database
            mySanctionNum = Properties.Settings.Default.AppSanctionNum;

            if (mySanctionNum == null)
            {
                MessageBox.Show("An active tournament must be selected from the Administration menu Tournament List option");
            }
            else
            {
                if (mySanctionNum.Length < 6)
                {
                    MessageBox.Show("An active tournament must be selected from the Administration menu Tournament List option");
                }
                else
                {
                    //Retrieve selected tournament attributes
                    DataTable curTourDataTable = getTourData(mySanctionNum);
                    if (curTourDataTable.Rows.Count > 0)
                    {
                        myTourRow   = curTourDataTable.Rows[0];
                        myTourRules = (String)myTourRow["Rules"];

                        if (myTourRules.ToLower().Equals("iwwf"))
                        {
                            kBasePointsButton.Checked = true;
                        }
                        else if (myTourRules.ToLower().Equals("ncwsa"))
                        {
                            plcmtPointsButton.Checked = true;
                        }
                        loadEventGroupList();
                    }
                }
            }
        }
示例#2
0
        private void TrickSummaryTeam_Load(object sender, EventArgs e)
        {
            if (Properties.Settings.Default.TrickTeamSummary_Width > 0)
            {
                this.Width = Properties.Settings.Default.TrickTeamSummary_Width;
            }
            if (Properties.Settings.Default.TrickTeamSummary_Height > 0)
            {
                this.Height = Properties.Settings.Default.TrickTeamSummary_Height;
            }
            if (Properties.Settings.Default.TrickTeamSummary_Location.X > 0 &&
                Properties.Settings.Default.TrickTeamSummary_Location.Y > 0)
            {
                this.Location = Properties.Settings.Default.TrickTeamSummary_Location;
            }
            myTourProperties = TourProperties.Instance;

            bestScoreButton.Checked = true;
            if (myTourProperties.TrickTeamSummaryDataType.ToLower().Equals("best"))
            {
                bestScoreButton.Checked = true;
            }
            if (myTourProperties.TrickTeamSummaryDataType.ToLower().Equals("total"))
            {
                totalScoreButton.Checked = true;
            }
            if (myTourProperties.TrickTeamSummaryDataType.ToLower().Equals("final"))
            {
                finalScoreButton.Checked = true;
            }
            rawScoreButton.Checked = true;
            if (myTourProperties.TrickTeamSummaryPlcmtMethod.ToLower().Equals("score"))
            {
                rawScoreButton.Checked = true;
            }
            if (myTourProperties.TrickTeamSummaryPlcmtMethod.ToLower().Equals("points"))
            {
                pointsScoreButton.Checked = true;
            }
            plcmtTourButton.Checked = true;
            if (myTourProperties.TrickTeamSummaryPlcmtOrg.ToLower().Equals("tour"))
            {
                plcmtTourButton.Checked = true;
            }
            if (myTourProperties.TrickTeamSummaryPlcmtOrg.ToLower().Equals("div"))
            {
                divPlcmtButton.Checked = true;
            }
            if (myTourProperties.SlalomTeamSummaryPlcmtOrg.ToLower().Equals("group"))
            {
                groupPlcmtButton.Checked = true;
            }
            plcmtPointsButton.Checked = true;
            if (myTourProperties.TrickTeamSummaryPointsMethod.ToLower().Equals("nops"))
            {
                nopsPointsButton.Checked = true;
            }
            if (myTourProperties.TrickTeamSummaryPointsMethod.ToLower().Equals("plcmt"))
            {
                plcmtPointsButton.Checked = true;
            }
            if (myTourProperties.TrickTeamSummaryPointsMethod.ToLower().Equals("kbase"))
            {
                kBasePointsButton.Checked = true;
            }
            if (myTourProperties.TrickTeamSummaryPointsMethod.ToLower().Equals("hcap"))
            {
                handicapPointsButton.Checked = true;
            }
            if (myTourProperties.TrickTeamSummaryPointsMethod.ToLower().Equals("ratio"))
            {
                ratioPointsButton.Checked = true;
            }

            // Retrieve data from database
            mySanctionNum = Properties.Settings.Default.AppSanctionNum;

            if (mySanctionNum == null)
            {
                MessageBox.Show("An active tournament must be selected from the Administration menu Tournament List option");
            }
            else
            {
                if (mySanctionNum.Length < 6)
                {
                    MessageBox.Show("An active tournament must be selected from the Administration menu Tournament List option");
                }
                else
                {
                    myNumPerTeam           = Convert.ToInt16(myTourProperties.TrickTeamSummary_NumPerTeam);
                    NumPerTeamTextBox.Text = myNumPerTeam.ToString();

                    //Retrieve selected tournament attributes
                    DataTable curTourDataTable = getTourData();
                    if (curTourDataTable.Rows.Count > 0)
                    {
                        myTourRow   = curTourDataTable.Rows[0];
                        myTourRules = (String)myTourRow["Rules"];
                        if (myTourRules.ToLower().Equals("ncwsa"))
                        {
                            Round.Visible      = false;
                            EventClass.Visible = false;
                        }
                        loadGroupList();
                    }
                }
            }
        }
        private void MasterSummaryOverallUS_Load(object sender, EventArgs e)
        {
            if (Properties.Settings.Default.MasterSummaryOverallUS_Width > 0)
            {
                this.Width = Properties.Settings.Default.MasterSummaryOverallUS_Width;
            }
            if (Properties.Settings.Default.MasterSummaryOverallUS_Height > 0)
            {
                this.Height = Properties.Settings.Default.MasterSummaryOverallUS_Height;
            }
            if (Properties.Settings.Default.MasterSummaryOverallUS_Location.X > 0 &&
                Properties.Settings.Default.MasterSummaryOverallUS_Location.Y > 0)
            {
                this.Location = Properties.Settings.Default.MasterSummaryOverallUS_Location;
            }
            myTourProperties = TourProperties.Instance;

            bestScoreButton.Checked = true;
            if (myTourProperties.MasterSummaryOverallDataType.ToLower().Equals("best"))
            {
                bestScoreButton.Checked = true;
            }
            if (myTourProperties.MasterSummaryOverallDataType.ToLower().Equals("round"))
            {
                roundScoreButton.Checked = true;
            }
            if (myTourProperties.MasterSummaryOverallDataType.ToLower().Equals("final"))
            {
                finalScoreButton.Checked = true;
            }

            pointsScoreButton.Checked = true;
            if (myTourProperties.MasterSummaryOverallPlcmtMethod.ToLower().Equals("points"))
            {
                pointsScoreButton.Checked = true;
            }
            if (myTourProperties.MasterSummaryOverallPlcmtMethod.ToLower().Equals("hcap"))
            {
                handicapScoreButton.Checked = true;
            }
            if (myTourProperties.MasterSummaryOverallPlcmtMethod.ToLower().Equals("ratio"))
            {
                ratioScoreButton.Checked = true;
            }

            plcmtDivButton.Checked = true;
            if (myTourProperties.MasterSummaryOverallPlcmtOrg.ToLower().Equals("div"))
            {
                plcmtDivButton.Checked = true;
            }
            if (myTourProperties.MasterSummaryOverallPlcmtOrg.ToLower().Equals("divgr"))
            {
                plcmtDivGrpButton.Checked = true;
            }
            if (myTourProperties.MasterSummaryOverallPlcmtOrg.ToLower().Equals("tour"))
            {
                plcmtTourButton.Checked = true;
            }
            if (myTourProperties.MasterSummaryOverallPlcmtOrg.ToLower().Equals("group"))
            {
                groupPlcmtButton.Checked = true;
            }

            nopsPointsButton.Checked = true;
            if (myTourProperties.MasterSummaryOverallPointsMethod.ToLower().Equals("nops"))
            {
                nopsPointsButton.Checked = true;
            }
            if (myTourProperties.MasterSummaryOverallPointsMethod.ToLower().Equals("plcmt"))
            {
                plcmtPointsButton.Checked = true;
            }
            if (myTourProperties.MasterSummaryOverallPointsMethod.ToLower().Equals("kbase"))
            {
                kBasePointsButton.Checked = true;
            }
            if (myTourProperties.MasterSummaryOverallPointsMethod.ToLower().Equals("ratio"))
            {
                ratioPointsButton.Checked = true;
            }

            showAllButton.Checked = true;
            if (myTourProperties.MasterSummaryOverallFilter.ToLower().Equals("all"))
            {
                showAllButton.Checked = true;
            }
            if (myTourProperties.MasterSummaryOverallFilter.ToLower().Equals("qualifed"))
            {
                showQlfyButton.Checked = true;
            }
            if (myTourProperties.MasterSummaryOverallFilter.ToLower().Equals("eligible"))
            {
                showEligButton.Checked = true;
            }

            // Retrieve data from database
            mySanctionNum = Properties.Settings.Default.AppSanctionNum;

            if (mySanctionNum == null)
            {
                MessageBox.Show("An active tournament must be selected from the Administration menu Tournament List option");
            }
            else
            {
                if (mySanctionNum.Length < 6)
                {
                    MessageBox.Show("An active tournament must be selected from the Administration menu Tournament List option");
                }
                else
                {
                    //Retrieve selected tournament attributes
                    DataTable curTourDataTable = getTourData();
                    if (curTourDataTable.Rows.Count > 0)
                    {
                        myTourRow   = curTourDataTable.Rows[0];
                        myTourRules = (String)myTourRow["Rules"];

                        if (myTourRules.ToLower().Equals("ncwsa"))
                        {
                            RoundOverall.Visible     = false;
                            RoundSlalom.Visible      = false;
                            RoundTrick.Visible       = false;
                            RoundJump.Visible        = false;
                            EventClassSlalom.Visible = false;
                            EventClassTrick.Visible  = false;
                            EventClassJump.Visible   = false;
                            TeamCodeNcwsa.Visible    = true;
                        }
                        else
                        {
                            RoundOverall.Visible     = true;
                            RoundSlalom.Visible      = true;
                            RoundTrick.Visible       = true;
                            RoundJump.Visible        = true;
                            EventClassSlalom.Visible = true;
                            EventClassTrick.Visible  = true;
                            EventClassJump.Visible   = true;
                            TeamCodeNcwsa.Visible    = false;
                        }

                        loadEventGroupList();
                    }
                }
            }
        }
        private void SystemMain_Load(object sender, EventArgs e)
        {
            //Calculate the application registry key
            String curUserAppRegName = Application.UserAppDataRegistry.ToString();

            String[] curNodes = curUserAppRegName.Split('/');
            if (curNodes.Length <= 1)
            {
                curNodes = curUserAppRegName.Split('\\');
            }
            String curAppRegName = "";

            for (int idx = 1; idx < curNodes.Length - 1; idx++)
            {
                if (curAppRegName.Length > 0)
                {
                    curAppRegName += '\\';
                }
                curAppRegName += curNodes[idx];
            }
            Properties.Settings.Default.AppRegistryName = curAppRegName;

            #region Set application window attributes from application configuration file
            if (Properties.Settings.Default.Mdi_Width > 0)
            {
                this.Width = Properties.Settings.Default.Mdi_Width;
            }
            if (Properties.Settings.Default.Mdi_Height > 0)
            {
                this.Height = Properties.Settings.Default.Mdi_Height;
            }
            if (Properties.Settings.Default.Mdi_Location.X > 0 &&
                Properties.Settings.Default.Mdi_Location.Y > 0)
            {
                this.Location = Properties.Settings.Default.Mdi_Location;
            }
            if (Properties.Settings.Default.Mdi_Title.Length > 0)
            {
                this.Text = Properties.Settings.Default.Mdi_Title;
            }
            else
            {
                this.Text = Properties.Settings.Default.AppTitle;
            }
            #endregion

            #region Check system settings and current database connection
            bool IsFirstRun    = false;
            bool showDebugMsgs = false;
            //showDebugMsgs = true;
            String myDataDirectory = "", myDeploymentDirectory = "", myDeploymentDataDirectory = "", curAppConnectString = "";

            myAppRegKey = Registry.CurrentUser.OpenSubKey(curAppRegName, true);
            if (myAppRegKey != null)
            {
                if (myAppRegKey.GetValue("ShowDebugValues") != null)
                {
                    String curShowDebugRegValue = myAppRegKey.GetValue("ShowDebugValues").ToString();
                    if (curShowDebugRegValue.Equals("true"))
                    {
                        showDebugMsgs = true;
                    }
                }
            }

            if (showDebugMsgs)
            {
                MessageBox.Show("Application Execution Information"
                                + "\n StartupPath=" + Application.StartupPath
                                + "\n\n UserAppDataPath=" + Application.UserAppDataPath
                                + "\n\n LocalUserAppDataPath=" + Application.LocalUserAppDataPath
                                + "\n\n ExecutablePath=" + Application.ExecutablePath
                                + "\n\n UserAppDataRegistry=" + Application.UserAppDataRegistry
                                + "\n\n ProductName=" + Application.ProductName
                                + "\n\n ProductVersion=" + Application.ProductVersion
                                );
            }

            //Check and set application version
            try {
                IsFirstRun = ApplicationDeployment.CurrentDeployment.IsFirstRun;
            } catch (Exception ex) {
                IsFirstRun = false;
            }
            try {
                Properties.Settings.Default.AppVersion = ApplicationDeployment.CurrentDeployment.CurrentVersion.ToString();
            } catch (Exception ex) {
                if (Properties.Settings.Default.AppVersion == null)
                {
                    Properties.Settings.Default.AppVersion = "0.00.00";
                }
                if (Properties.Settings.Default.AppVersion.Length == 0)
                {
                    Properties.Settings.Default.AppVersion = "0.00.00";
                }
            }
            //Check and set user data directory
            try {
                myDeploymentDataDirectory = Application.LocalUserAppDataPath;
                myDeploymentDirectory     = Application.StartupPath;
                if (myDeploymentDirectory == null)
                {
                    myDeploymentDirectory = "";
                }
                curAppConnectString = Properties.Settings.Default.waterskiConnectionStringApp;
            } catch (Exception ex) {
                myDeploymentDirectory = "";
                if (myAppRegKey.GetValue("DataDirectory") == null)
                {
                    myDataDirectory = Application.UserAppDataPath;
                    myAppRegKey.SetValue("DataDirectory", myDataDirectory);
                }
                myDataDirectory = myAppRegKey.GetValue("DataDirectory").ToString();
                AppDomain.CurrentDomain.SetData("DataDirectory", myDataDirectory);
            }

            try {
                //Determine if data directory is available in the registry
                //If available in registry than assume that is the most current
                if (myDeploymentDirectory.Length < 1)
                {
                    myDeploymentDirectory = "C:\\Users\\AllenFamily\\Documents\\Visual Studio 2010\\Projects\\WaterskiScoringSystem\\WaterskiScoringSystem\\bin\\Debug";
                }
                if (myDeploymentDataDirectory.Length < 1)
                {
                    myDeploymentDataDirectory = "C:\\Users\\AllenFamily\\Documents\\Visual Studio 2010\\Projects\\WaterskiScoringSystem\\WaterskiScoringSystem\\bin\\Debug";
                }

                if (myAppRegKey.GetValue("DataDirectory") == null)
                {
                    myDataDirectory = "";
                }
                else
                {
                    myDataDirectory = myAppRegKey.GetValue("DataDirectory").ToString();
                }
                #region Debug Msgs
                if (showDebugMsgs)
                {
                    StringBuilder tmpMsg = new StringBuilder();
                    try {
                        tmpMsg.Append("\n DataDirectory=" + ApplicationDeployment.CurrentDeployment.DataDirectory);
                    } catch {
                    }
                    try {
                        tmpMsg.Append("\n CommonAppDataPath=" + Application.CommonAppDataPath);
                    } catch {
                    }
                    try {
                        tmpMsg.Append("\n\n CurrentVersion=" + ApplicationDeployment.CurrentDeployment.CurrentVersion);
                    } catch {
                    }
                    try {
                        tmpMsg.Append("\n\n IsFirstRun=" + ApplicationDeployment.CurrentDeployment.IsFirstRun);
                    } catch {
                    }
                    try {
                        tmpMsg.Append("\n\n AppConnectString=" + curAppConnectString);
                    } catch {
                    }
                    try {
                        tmpMsg.Append("\n\n myDataDirectory=" + myDataDirectory);
                    } catch {
                    }
                    try {
                        tmpMsg.Append("\n myDeploymentDirectory=" + myDeploymentDirectory);
                    } catch {
                    }
                    try {
                        tmpMsg.Append("\n myDeploymentDataDirectory=" + myDeploymentDataDirectory);
                    } catch {
                    }
                    MessageBox.Show("Application Execution Information - CurrentDeployment" + tmpMsg.ToString());
                }
                #endregion
                if (myDataDirectory.Length > 1)
                {
                    if (showDebugMsgs)
                    {
                        MessageBox.Show("Application Execution Information - CurrentDeployment"
                                        + "\n myAppRegKey DataDirectory=" + myDataDirectory);
                    }
                    //If first run after a new version has been loaded or on first loaded
                    //IsFirstRun = true;
                    if (IsFirstRun)
                    {
                        //Save current version to registry
                        myAppRegKey.SetValue("CurrentVersion", Properties.Settings.Default.AppVersion);
                        //Establish active data directory in active application domain
                        AppDomain.CurrentDomain.SetData("DataDirectory", myDataDirectory);
                        //Check for existing database in active data directory
                        //If one exists give user option to keep existing or loading application default
                        //If one does not exist load application default to user data directory
                        if (checkDbConnection(curAppConnectString))
                        {
                            //Eliminate the option to replace database because data was being inadvertently overlayed.
                        }
                        else
                        {
                            MessageBox.Show("Database not found at the specified location " + myDataDirectory
                                            + "\n\n" + "In the file open dialog to follow please select a location and provide a file name"
                                            + "\n" + "The database supplied with the application will be copied to your specified location");
                            copyDatabase(myDeploymentDataDirectory, myDataDirectory, myAppRegKey);
                        }
                    }
                    else
                    {
                        //Establish active data directory in active application domain
                        AppDomain.CurrentDomain.SetData("DataDirectory", myDataDirectory);
                        String curPropAppVersion = Properties.Settings.Default.AppVersion;
                        String curRegAppVersion  = "";
                        try {
                            curRegAppVersion = myAppRegKey.GetValue("CurrentVersion").ToString();
                        } catch (Exception ex) {
                            curRegAppVersion = "0.00.00";
                        }

                        if (!(curPropAppVersion.Equals(curRegAppVersion)))
                        {
                            //New version has been detected.  Save new version in registry
                            //Determine if valid database exists at current data directory location.
                            //If one exists give user option to keep existing or loading application default
                            //If one does not exist load application default to user data directory
                            myAppRegKey.SetValue("CurrentVersion", Properties.Settings.Default.AppVersion);
                            if (checkDbConnection(curAppConnectString))
                            {
                            }
                            else
                            {
                                MessageBox.Show("Database not found at the specified location " + myDataDirectory
                                                + "\n\n" + "In the file open dialog to follow please select a location and provide a file name"
                                                + "\n" + "The database supplied with the application will be copied to your specified location");
                                copyDatabase(myDeploymentDataDirectory, myDataDirectory, myAppRegKey);
                            }
                        }
                    }
                }
                else
                {
                    //Establish current data directry using application default
                    //Analyze default location and establish the desired data directory
                    myDataDirectory = myDeploymentDirectory;
                    int posDelim = myDataDirectory.IndexOf("/Data");
                    if (posDelim > 0)
                    {
                        String tmpDataDirectory = myDataDirectory.Substring(0, posDelim + 5);
                        if (showDebugMsgs)
                        {
                            MessageBox.Show("tmpDataDirectory = " + tmpDataDirectory);
                        }
                        //Establish active data directory in active application domain
                        myDataDirectory = tmpDataDirectory;
                    }
                    MessageBox.Show("Database location has not been specified"
                                    + "\n\n" + "In the next dialog that displays please select a location and provide a file name for the database (default name is waterski.sdf) "
                                    + "\n" + "The database supplied with the application will be copied to your specified location");
                    copyDatabase(myDeploymentDataDirectory, myDataDirectory, myAppRegKey);
                }
            } catch (Exception ex) {
                MessageBox.Show("Exception encountered during application load \n" + ex.Message);
            }

            myDataDirectory     = myAppRegKey.GetValue("DataDirectory").ToString();
            curAppConnectString = Properties.Settings.Default.waterskiConnectionStringApp;
            if (checkDbConnection(curAppConnectString))
            {
                UpgradeDatabase curUpgradeDatabase = new UpgradeDatabase();
                curUpgradeDatabase.checkForUpgrade();

                //Check to ensure currently active tournament is a valid tournament in the current database
                String mySanctionNum = Properties.Settings.Default.AppSanctionNum;
                if (mySanctionNum != null)
                {
                    if (mySanctionNum.Length == 6)
                    {
                        Log.OpenFile(null);
                        DataTable curTourDataTable = getTourData(mySanctionNum);
                        if (curTourDataTable.Rows.Count > 0)
                        {
                            TourProperties curTourProperties = TourProperties.Instance;
                            curTourProperties.loadProperties((String)curTourDataTable.Rows[0]["Rules"], (String)curTourDataTable.Rows[0]["Class"]);
                        }
                        else
                        {
                            Properties.Settings.Default.AppSanctionNum = "";
                            this.Text = Properties.Settings.Default.AppTitle;
                        }
                    }
                    else
                    {
                        Properties.Settings.Default.AppSanctionNum = "";
                        this.Text = Properties.Settings.Default.AppTitle;
                    }
                }
            }
            else
            {
                Properties.Settings.Default.AppSanctionNum = "";
                this.Text = Properties.Settings.Default.AppTitle;

                MessageBox.Show("Database connection failed"
                                + "\n Use the Tools menu,  SetDatabaseLocaton option, to find and set your database"
                                + "\n\n DataDirectory: " + myDataDirectory
                                + "\n\n AppConnectString: " + curAppConnectString);
            }

            if (showDebugMsgs)
            {
                MessageBox.Show("Application Execution Information"
                                + "\n StartupPath=" + Application.StartupPath
                                + "\n\n UserAppDataPath=" + Application.UserAppDataPath
                                + "\n\n LocalUserAppDataPath=" + Application.LocalUserAppDataPath
                                + "\n\n ExecutablePath=" + Application.ExecutablePath
                                + "\n\n UserAppDataRegistry=" + Application.UserAppDataRegistry
                                + "\n\n ProductName=" + Application.ProductName
                                + "\n\n ProductVersion=" + Application.ProductVersion
                                );
            }
            #endregion
        }
示例#5
0
        private void updateTourProperties()
        {
            String curPropValue = "", curPropKey = "";

            try {
                myTourProperties = TourProperties.Instance;

                //myTourProperties.MasterSummaryDataType
                curPropKey   = "MasterSummaryDataType";
                curPropValue = "best";
                if (bestScoreButton.Checked)
                {
                    curPropValue = "best";
                }
                if (firstScoreButton.Checked)
                {
                    curPropValue = "first";
                }
                if (finalScoreButton.Checked)
                {
                    curPropValue = "final";
                }
                if (totalScoreButton.Checked)
                {
                    curPropValue = "total";
                }
                updateTournamentProperty(mySanctionNum, curPropKey, curPropValue, 100);
                updateTournamentProperty(mySanctionNum, "SlalomSummaryDataType", curPropValue, 300);
                updateTournamentProperty(mySanctionNum, "TrickSummaryDataType", curPropValue, 400);
                updateTournamentProperty(mySanctionNum, "JumpSummaryDataType", curPropValue, 500);
                if (Properties.Settings.Default.AppSanctionNum.Equals(mySanctionNum))
                {
                    myTourProperties.MasterSummaryDataType = curPropValue;
                    myTourProperties.SlalomSummaryDataType = curPropValue;
                    myTourProperties.TrickSummaryDataType  = curPropValue;
                    myTourProperties.JumpSummaryDataType   = curPropValue;
                }

                //myTourProperties.MasterSummaryPointsMethod
                curPropKey   = "MasterSummaryPointsMethod";
                curPropValue = "nops";
                if (nopsPointsButton.Checked)
                {
                    curPropValue = "nops";
                }
                if (kBasePointsButton.Checked)
                {
                    curPropValue = "kbase";
                }
                if (plcmtPointsButton.Checked)
                {
                    curPropValue = "plcmt";
                }
                if (ratioPointsButton.Checked)
                {
                    curPropValue = "ratio";
                }
                updateTournamentProperty(mySanctionNum, curPropKey, curPropValue, 100);
                updateTournamentProperty(mySanctionNum, "SlalomSummaryPointsMethod", curPropValue, 300);
                updateTournamentProperty(mySanctionNum, "TrickSummaryPointsMethod", curPropValue, 400);
                updateTournamentProperty(mySanctionNum, "JumpSummaryPointsMethod", curPropValue, 500);
                if (Properties.Settings.Default.AppSanctionNum.Equals(mySanctionNum))
                {
                    myTourProperties.MasterSummaryPointsMethod = curPropValue;
                    myTourProperties.SlalomSummaryPointsMethod = curPropValue;
                    myTourProperties.TrickSummaryPointsMethod  = curPropValue;
                    myTourProperties.JumpSummaryPointsMethod   = curPropValue;
                }

                //myTourProperties.MasterSummaryPlcmtMethod
                curPropKey   = "MasterSummaryPlcmtMethod";
                curPropValue = "score";
                if (rawScoreButton.Checked)
                {
                    curPropValue = "score";
                }
                if (pointsScoreButton.Checked)
                {
                    curPropValue = "points";
                }
                updateTournamentProperty(mySanctionNum, curPropKey, curPropValue, 100);
                updateTournamentProperty(mySanctionNum, "SlalomSummaryPlcmtMethod", curPropValue, 300);
                updateTournamentProperty(mySanctionNum, "TrickSummaryPlcmtMethod", curPropValue, 400);
                updateTournamentProperty(mySanctionNum, "JumpSummaryPlcmtMethod", curPropValue, 500);
                if (Properties.Settings.Default.AppSanctionNum.Equals(mySanctionNum))
                {
                    myTourProperties.MasterSummaryPlcmtMethod = curPropValue;
                    myTourProperties.SlalomSummaryPlcmtMethod = curPropValue;
                    myTourProperties.TrickSummaryPlcmtMethod  = curPropValue;
                    myTourProperties.JumpSummaryPlcmtMethod   = curPropValue;
                }

                //myTourProperties.MasterSummaryPlcmtOrg
                curPropKey   = "MasterSummaryPlcmtOrg";
                curPropValue = "div";
                if (plcmtDivButton.Checked)
                {
                    curPropValue = "div";
                }
                if (plcmtDivGrpButton.Checked)
                {
                    curPropValue = "divgr";
                }
                updateTournamentProperty(mySanctionNum, curPropKey, curPropValue, 100);
                updateTournamentProperty(mySanctionNum, "SlalomSummaryPlcmtOrg", curPropValue, 300);
                updateTournamentProperty(mySanctionNum, "TrickSummaryPlcmtOrg", curPropValue, 400);
                updateTournamentProperty(mySanctionNum, "JumpSummaryPlcmtOrg", curPropValue, 500);
                if (Properties.Settings.Default.AppSanctionNum.Equals(mySanctionNum))
                {
                    myTourProperties.MasterSummaryPlcmtOrg = curPropValue;
                    myTourProperties.SlalomSummaryPlcmtOrg = curPropValue;
                    myTourProperties.TrickSummaryPlcmtOrg  = curPropValue;
                    myTourProperties.JumpSummaryPlcmtOrg   = curPropValue;
                }

                //myTourProperties.MasterSummaryOverallDataType
                curPropKey   = "MasterSummaryOverallDataType";
                curPropValue = "best";
                if (bestScoreOverallButton.Checked)
                {
                    curPropValue = "best";
                }
                if (roundScoreOverallButton.Checked)
                {
                    curPropValue = "round";
                }
                if (finalScoreOverallButton.Checked)
                {
                    curPropValue = "final";
                }
                updateTournamentProperty(mySanctionNum, curPropKey, curPropValue, 110);
                if (Properties.Settings.Default.AppSanctionNum.Equals(mySanctionNum))
                {
                    myTourProperties.MasterSummaryOverallDataType = curPropValue;
                }

                //myTourProperties.MasterSummaryOverallPointsMethod
                curPropKey   = "MasterSummaryOverallPointsMethod";
                curPropValue = "nops";
                if (nopsPointsOverallButton.Checked)
                {
                    curPropValue = "nops";
                }
                if (kBasePointsOverallButton.Checked)
                {
                    curPropValue = "kbase";
                }
                if (plcmtPointsOverallButton.Checked)
                {
                    curPropValue = "plcmt";
                }
                if (ratioPointsOverallButton.Checked)
                {
                    curPropValue = "ratio";
                }
                updateTournamentProperty(mySanctionNum, curPropKey, curPropValue, 110);
                if (Properties.Settings.Default.AppSanctionNum.Equals(mySanctionNum))
                {
                    myTourProperties.MasterSummaryOverallPointsMethod = curPropValue;
                }

                //myTourProperties.MasterSummaryOverallPlcmtMethod
                curPropKey   = "MasterSummaryOverallPlcmtMethod";
                curPropValue = "points";
                if (pointsScoreOverallButton.Checked)
                {
                    curPropValue = "points";
                }
                if (ratioScoreOverallButton.Checked)
                {
                    curPropValue = "ratio";
                }
                if (handicapScoreOverallButton.Checked)
                {
                    curPropValue = "hcap";
                }
                updateTournamentProperty(mySanctionNum, curPropKey, curPropValue, 110);
                if (Properties.Settings.Default.AppSanctionNum.Equals(mySanctionNum))
                {
                    myTourProperties.MasterSummaryOverallPlcmtMethod = curPropValue;
                }

                //myTourProperties.MasterSummaryOverallPlcmtOrg
                curPropKey   = "MasterSummaryOverallPlcmtOrg";
                curPropValue = "div";
                if (plcmtDivOverallButton.Checked)
                {
                    curPropValue = "div";
                }
                if (plcmtDivGrpOverallButton.Checked)
                {
                    curPropValue = "divgr";
                }
                if (plcmtGroupOverallButton.Checked)
                {
                    curPropValue = "group";
                }
                if (plcmtTourOverallButton.Checked)
                {
                    curPropValue = "tour";
                }
                updateTournamentProperty(mySanctionNum, curPropKey, curPropValue, 110);
                if (Properties.Settings.Default.AppSanctionNum.Equals(mySanctionNum))
                {
                    myTourProperties.MasterSummaryOverallPlcmtOrg = curPropValue;
                }

                //myTourProperties.TeamSummaryDataType
                curPropKey   = "TeamSummaryDataType";
                curPropValue = "best";
                if (bestScoreTeamButton.Checked)
                {
                    curPropValue = "best";
                }
                if (finalScoreTeamButton.Checked)
                {
                    curPropValue = "final";
                }
                if (totalScoreTeamButton.Checked)
                {
                    curPropValue = "total";
                }
                updateTournamentProperty(mySanctionNum, curPropKey, curPropValue, 900);
                updateTournamentProperty(mySanctionNum, "SlalomTeamSummaryDataType", curPropValue, 910);
                updateTournamentProperty(mySanctionNum, "TrickTeamSummaryDataType", curPropValue, 920);
                updateTournamentProperty(mySanctionNum, "JumpTeamSummaryDataType", curPropValue, 930);
                if (Properties.Settings.Default.AppSanctionNum.Equals(mySanctionNum))
                {
                    myTourProperties.TeamSummaryDataType       = curPropValue;
                    myTourProperties.SlalomTeamSummaryDataType = curPropValue;
                    myTourProperties.TrickTeamSummaryDataType  = curPropValue;
                    myTourProperties.JumpTeamSummaryDataType   = curPropValue;
                }

                //myTourProperties.TeamSummaryPointsMethod
                curPropKey   = "TeamSummaryPointsMethod";
                curPropValue = "nops";
                if (nopsPointsTeamButton.Checked)
                {
                    curPropValue = "nops";
                }
                if (kBasePointsTeamButton.Checked)
                {
                    curPropValue = "kbase";
                }
                if (plcmtPointsTeamButton.Checked)
                {
                    curPropValue = "plcmt";
                }
                if (ratioPointsTeamButton.Checked)
                {
                    curPropValue = "ratio";
                }
                updateTournamentProperty(mySanctionNum, curPropKey, curPropValue, 900);
                updateTournamentProperty(mySanctionNum, "SlalomTeamSummaryPointsMethod", curPropValue, 910);
                updateTournamentProperty(mySanctionNum, "TrickTeamSummaryPointsMethod", curPropValue, 920);
                updateTournamentProperty(mySanctionNum, "JumpTeamSummaryPointsMethod", curPropValue, 930);
                if (Properties.Settings.Default.AppSanctionNum.Equals(mySanctionNum))
                {
                    myTourProperties.TeamSummaryPointsMethod       = curPropValue;
                    myTourProperties.SlalomTeamSummaryPointsMethod = curPropValue;
                    myTourProperties.TrickTeamSummaryPointsMethod  = curPropValue;
                    myTourProperties.JumpTeamSummaryPointsMethod   = curPropValue;
                }

                //myTourProperties.TeamSummaryPlcmtMethod
                curPropKey   = "TeamSummaryPlcmtMethod";
                curPropValue = "points";
                if (pointsScoreTeamButton.Checked)
                {
                    curPropValue = "points";
                }
                if (handicapScoreTeamButton.Checked)
                {
                    curPropValue = "hcap";
                }
                if (ratioScoreTeamButton.Checked)
                {
                    curPropValue = "ratio";
                }
                updateTournamentProperty(mySanctionNum, curPropKey, curPropValue, 900);
                updateTournamentProperty(mySanctionNum, "SlalomTeamSummaryPlcmtMethod", curPropValue, 910);
                updateTournamentProperty(mySanctionNum, "TrickTeamSummaryPlcmtMethod", curPropValue, 920);
                updateTournamentProperty(mySanctionNum, "JumpTeamSummaryPlcmtOrg", curPropValue, 930);
                if (Properties.Settings.Default.AppSanctionNum.Equals(mySanctionNum))
                {
                    myTourProperties.TeamSummaryPlcmtMethod       = curPropValue;
                    myTourProperties.SlalomTeamSummaryPlcmtMethod = curPropValue;
                    myTourProperties.TrickTeamSummaryPlcmtMethod  = curPropValue;
                    myTourProperties.JumpTeamSummaryPlcmtOrg      = curPropValue;
                }

                //myTourProperties.TeamSummaryPlcmtOrg
                curPropKey   = "TeamSummaryPlcmtOrg";
                curPropValue = "div";
                if (plcmtDivTeamButton.Checked)
                {
                    curPropValue = "div";
                }
                if (plcmtTourTeamButton.Checked)
                {
                    curPropValue = "Tour";
                }
                updateTournamentProperty(mySanctionNum, curPropKey, curPropValue, 900);
                updateTournamentProperty(mySanctionNum, "SlalomTeamSummaryPlcmtOrg", curPropValue, 910);
                updateTournamentProperty(mySanctionNum, "TrickTeamSummaryPlcmtOrg", curPropValue, 920);
                updateTournamentProperty(mySanctionNum, "JumpTeamSummaryPlcmtOrg", curPropValue, 930);
                if (Properties.Settings.Default.AppSanctionNum.Equals(mySanctionNum))
                {
                    myTourProperties.TeamSummaryPlcmtOrg       = curPropValue;
                    myTourProperties.SlalomTeamSummaryPlcmtOrg = curPropValue;
                    myTourProperties.TrickTeamSummaryPlcmtOrg  = curPropValue;
                    myTourProperties.JumpTeamSummaryPlcmtOrg   = curPropValue;
                }

                if (myTourRules.ToLower().Equals("ncwsa"))
                {
                    if (myTourName.ToLower().Contains("all star"))
                    {
                        myTourProperties.TeamSummary_NumPerTeam       = "10";
                        myTourProperties.SlalomTeamSummary_NumPerTeam = "10";
                        myTourProperties.TrickTeamSummary_NumPerTeam  = "10";
                        myTourProperties.JumpTeamSummary_NumPerTeam   = "10";
                    }
                    else
                    {
                        myTourProperties.TeamSummary_NumPerTeam       = "4";
                        myTourProperties.SlalomTeamSummary_NumPerTeam = "4";
                        myTourProperties.TrickTeamSummary_NumPerTeam  = "4";
                        myTourProperties.JumpTeamSummary_NumPerTeam   = "4";
                    }
                }

                isDataModified = false;
            } catch (Exception excp) {
                String curMsg = ":Error attempting to update tournament property " + curPropKey + "\n" + excp.Message;
                MessageBox.Show(curMsg);
            }
        }