private void CheckForIncompleteSkiers()
        {
            CalcScoreSummary myCalcScoreSummary = new CalcScoreSummary();
            DataTable        curDataTable       = myCalcScoreSummary.getIncompleteSkiers(mySanctionNum);

            TourPackageButton.BeginInvoke((MethodInvoker) delegate() {
                Application.DoEvents();
                Cursor.Current = Cursors.Default;
            });

            if (curDataTable.Rows.Count > 0)
            {
                StringBuilder curMsg = new StringBuilder("");
                curMsg.Append("There are " + curDataTable.Rows.Count + " skiers that have incomplete scores or are marked as not ready to ski"
                              + "\nNote that skiers marked as not ready to ski will not be included in the scorebook or the skier performance file");
                curMsg.Append("\n\nSkierName AgeGroup Event Round Status");
                foreach (DataRow curRow in curDataTable.Rows)
                {
                    curMsg.Append("\n" + curRow["SkierName"]);
                    curMsg.Append(" " + curRow["AgeGroup"]);
                    curMsg.Append(" " + curRow["Event"]);
                    curMsg.Append(" " + curRow["Round"]);
                    curMsg.Append(" " + curRow["Status"]);
                }
                MessageBox.Show(curMsg.ToString());
            }
        }
        public void navRefresh_Click(object sender, EventArgs e)
        {
            if (mySanctionNum != null && myTourRow != null)
            {
                String curDataType = "best", curPlcmtMethod = "score", curPointsMethod = "";
                String curPlcmtOrg = "", curPlcmtOverallOrg = "";
                //String curPlcmtOrg = "div";

                CalcScoreSummary curCalcSummary = new CalcScoreSummary();

                // Retrieve data from database depending on selection criteria
                String curMsg = "Tournament scores retrieved ";

                if (bestScoreButton.Checked)
                {
                    curDataType       = "best";
                    winStatusMsg.Text = curMsg + "- best scores ";
                }
                else if (totalScoreButton.Checked)
                {
                    curDataType       = "total";
                    winStatusMsg.Text = curMsg + "- total scores";
                }
                else if (finalScoreButton.Checked)
                {
                    curDataType       = "final";
                    winStatusMsg.Text = curMsg + "- final scores";
                }
                else if (firstScoreButton.Checked)
                {
                    curDataType       = "first";
                    winStatusMsg.Text = curMsg + "- first scores";
                }
                myTourProperties.TrickScorebookDataType = curDataType;
                if (nopsPointsButton.Checked)
                {
                    curPointsMethod = "nops";
                }
                else if (plcmtPointsButton.Checked)
                {
                    curPointsMethod = "plcmt";
                }
                else if (kBasePointsButton.Checked)
                {
                    curPointsMethod = "kbase";
                }
                else if (ratioPointsButton.Checked)
                {
                    curPointsMethod = "ratio";
                }
                else
                {
                    curPointsMethod = "nops";
                }
                myTourProperties.TrickScorebookPointsMethod = curPointsMethod;

                if (plcmtDivButton.Checked)
                {
                    curPlcmtOrg        = "div";
                    curPlcmtOverallOrg = "agegroup";
                    EventGroup.Visible = false;
                }
                else if (plcmtDivGrpButton.Checked)
                {
                    curPlcmtOrg        = "divgr";
                    curPlcmtOverallOrg = "agegroupgroup";
                    EventGroup.Visible = true;
                }
                else
                {
                    curPlcmtOrg        = "div";
                    curPlcmtOverallOrg = "agegroup";
                    EventGroup.Visible = false;
                }
                myTourProperties.TrickScorebookPlcmtOrg = curPlcmtOrg;

                Cursor.Current = Cursors.WaitCursor;
                scoreSummaryDataGridView.BeginInvoke((MethodInvoker) delegate() {
                    Application.DoEvents();
                    winStatusMsg.Text = "Tournament entries retrieved";
                });

                String curGroupValue = "";
                try {
                    curGroupValue = EventGroupList.SelectedItem.ToString();
                    if (!(curGroupValue.ToLower().Equals("all")))
                    {
                        if (myTourRules.ToLower().Equals("ncwsa"))
                        {
                            if (curGroupValue.ToUpper().Equals("MEN A"))
                            {
                                curGroupValue = "CM";
                            }
                            else if (curGroupValue.ToUpper().Equals("WOMEN A"))
                            {
                                curGroupValue = "CW";
                            }
                            else if (curGroupValue.ToUpper().Equals("MEN B"))
                            {
                                curGroupValue = "BM";
                            }
                            else if (curGroupValue.ToUpper().Equals("WOMEN B"))
                            {
                                curGroupValue = "BW";
                            }
                            else
                            {
                                curGroupValue = "All";
                            }
                        }
                    }
                } catch {
                    curGroupValue = "All";
                }

                if (curGroupValue.ToLower().Equals("all"))
                {
                    if (myTourRules.ToLower().Equals("iwwf") && curPointsMethod.ToLower().Equals("kbase"))
                    {
                        mySummaryDataTable = curCalcSummary.CalcIwwfEventPlcmts(myTourRow, mySanctionNum, "Scorebook", myTourRules, curDataType, curPlcmtMethod, curPlcmtOrg, curPointsMethod, null, null);
                    }
                    else
                    {
                        myTrickDataTable   = curCalcSummary.getTrickSummary(myTourRow, curDataType, curPlcmtMethod, curPlcmtOrg, curPointsMethod);
                        mySummaryDataTable = curCalcSummary.buildOverallSummary(myTourRow, null, myTrickDataTable, null, curDataType, curPlcmtOverallOrg);

                        myMemberData       = curCalcSummary.getMemberData(mySanctionNum);
                        myTrickDetail      = curCalcSummary.getTrickScoreDetail(myTourRow, curPlcmtMethod, curPlcmtOrg, curPointsMethod, null, null);
                        mySummaryDataTable = curCalcSummary.buildTourScorebook(mySanctionNum, myTourRow, myMemberData, mySummaryDataTable, null, myTrickDetail, null);
                    }
                }
                else
                {
                    if (myTourRules.ToLower().Equals("iwwf") && curPointsMethod.ToLower().Equals("kbase"))
                    {
                        mySummaryDataTable = curCalcSummary.CalcIwwfEventPlcmts(myTourRow, mySanctionNum, "Scorebook", myTourRules, curDataType, curPlcmtMethod, curPlcmtOrg, curPointsMethod, "All", curGroupValue);
                    }
                    else
                    {
                        myTrickDataTable   = curCalcSummary.getTrickSummary(myTourRow, curDataType, curPlcmtMethod, curPlcmtOrg, curPointsMethod, "All", curGroupValue);
                        mySummaryDataTable = curCalcSummary.buildOverallSummary(myTourRow, null, myTrickDataTable, null, curDataType, curPlcmtOverallOrg);

                        myMemberData       = curCalcSummary.getMemberData(mySanctionNum, curGroupValue);
                        myTrickDetail      = curCalcSummary.getTrickScoreDetail(myTourRow, curPlcmtMethod, curPlcmtOrg, curPointsMethod, "All", curGroupValue);
                        mySummaryDataTable = curCalcSummary.buildTourScorebook(mySanctionNum, myTourRow, myMemberData, mySummaryDataTable, null, myTrickDetail, null);
                    }
                }

                loadSummaryDataGrid();
                Cursor.Current = Cursors.Default;
            }
        }
        public Boolean ExportScorebookPublishFmtData()
        {
            String        curMethodName = "ExportScorebookPublishFmtData";
            Boolean       returnStatus = false;
            StringBuilder outLine = new StringBuilder("");
            String        curMsg = "", curMemberId = "", curAgeGroup = "", prevAgeGroup = "";
            String        curFileFilter = "TXT files (*.txt)|*.txt|All files (*.*)|*.*";
            Int16         curRound = 0, curOverallPlcmt = 0;
            DataRow       prevRow = null;

            DataRow[] curScoreSlalomRows = null, curScoreTrickRows = null, curScoreJumpRows = null;

            try {
                curMsg = "Exporting Scorebook Publish Data";
                Log.WriteFile(curMethodName + ":begin: " + curMsg);
                String       curFilename = mySanctionNum.Trim() + "-publish.txt";
                StreamWriter outBuffer   = getExportFile(curFileFilter, curFilename);

                if (outBuffer == null)
                {
                    curMsg = "Output file not available";
                }
                else
                {
                    String curPlcmtMethod = "score"
                    , curPlcmtOverallOrg  = "agegroup"
                    , curDataType         = "best"
                    , curPointsMethod     = "nops"
                    , curPlcmtOrg         = "div";

                    myProgressInfo = new ProgressWindow();
                    myProgressInfo.setProgessMsg("Processing Scorebook Publish Data");
                    myProgressInfo.Show();
                    myProgressInfo.Refresh();
                    myProgressInfo.setProgressMax(10);

                    CalcScoreSummary curCalcSummary    = new CalcScoreSummary();
                    DataTable        mySlalomDataTable = curCalcSummary.getSlalomSummary(myTourRow, curDataType, curPlcmtMethod, curPlcmtOrg, curPointsMethod);
                    myProgressInfo.setProgressValue(1);
                    myProgressInfo.Refresh();
                    DataTable myTrickDataTable = curCalcSummary.getTrickSummary(myTourRow, curDataType, curPlcmtMethod, curPlcmtOrg, curPointsMethod);
                    myProgressInfo.setProgressValue(2);
                    myProgressInfo.Refresh();
                    DataTable myJumpDataTable = curCalcSummary.getJumpSummary(myTourRow, curDataType, curPlcmtMethod, curPlcmtOrg, curPointsMethod);
                    myProgressInfo.setProgressValue(3);
                    myProgressInfo.Refresh();
                    DataTable mySummaryDataTable = curCalcSummary.buildOverallSummary(myTourRow, mySlalomDataTable, myTrickDataTable, myJumpDataTable, curDataType, curPlcmtOverallOrg);
                    foreach (DataRow curRow in mySummaryDataTable.Rows)
                    {
                        if (((String)curRow["QualifyOverall"]).ToUpper().Equals("YES"))
                        {
                        }
                        else
                        {
                            curRow["ScoreOverall"] = 0;
                        }
                    }
                    myProgressInfo.setProgressValue(4);
                    myProgressInfo.Refresh();

                    mySummaryDataTable.DefaultView.Sort = "AgeGroup ASC, QualifyOverall Desc, ScoreOverall Desc, SkierName ASC";
                    DataTable curSummaryDataTable = mySummaryDataTable.DefaultView.ToTable();

                    myProgressInfo.setProgressMax(mySummaryDataTable.Rows.Count);
                    myProgressInfo.Refresh();

                    //Build file header line and write to file
                    writeHeader(outBuffer);

                    int curRowCount = 0;
                    foreach (DataRow curRow in curSummaryDataTable.Rows)
                    {
                        curRowCount++;
                        myProgressInfo.setProgressValue(curRowCount);
                        myProgressInfo.Refresh();

                        curMemberId = curRow["MemberId"].ToString();
                        curAgeGroup = curRow["AgeGroup"].ToString();
                        if (curAgeGroup != prevAgeGroup)
                        {
                            if (prevAgeGroup.Length > 0)
                            {
                                outBuffer.WriteLine("");
                                curOverallPlcmt = 0;
                            }

                            //Write skier identification information
                            outLine = new StringBuilder("");
                            outLine.Append(writeDivisionHeader(outBuffer, curAgeGroup));
                        }

                        curScoreSlalomRows = mySlalomDataTable.Select("MemberId = '" + curMemberId + "' AND AgeGroup = '" + curAgeGroup + "'");
                        curScoreTrickRows  = myTrickDataTable.Select("MemberId = '" + curMemberId + "' AND AgeGroup = '" + curAgeGroup + "'");
                        curScoreJumpRows   = myJumpDataTable.Select("MemberId = '" + curMemberId + "' AND AgeGroup = '" + curAgeGroup + "'");

                        //Initialize control fields
                        prevAgeGroup = curAgeGroup;

                        //Initialize output buffer
                        outLine = new StringBuilder("");

                        //Write skier identification information
                        outLine.Append(writeSkierInfo(curRow, curRound));

                        //Write skier performance summary information
                        outLine.Append(writeSkierSlalomScore(curRow, curScoreSlalomRows));

                        outLine.Append(writeSkierTrickScore(curRow, curScoreTrickRows));

                        outLine.Append(writeSkierJumpScore(curRow, curScoreJumpRows));

                        curOverallPlcmt++;
                        outLine.Append(writeSkierOverallScore(curRow, curOverallPlcmt));
                        //Write output line to file
                        outBuffer.WriteLine(outLine.ToString());
                    }

                    //Build file footer and write to file
                    outLine = new StringBuilder("");
                    outBuffer.WriteLine(outLine.ToString());

                    returnStatus = true;
                    outBuffer.Close();

                    myProgressInfo.Close();
                    if (mySummaryDataTable.Rows.Count > 0)
                    {
                        curMsg = mySummaryDataTable.Rows.Count + " skiers found and written";
                    }
                    else
                    {
                        curMsg = "No rows found";
                    }
                }
                MessageBox.Show(curMsg);
                Log.WriteFile(curMethodName + ":conplete: " + curMsg);
            } catch (Exception ex) {
                MessageBox.Show("Error:" + curMethodName + " Could not write file from data input\n\nError: " + ex.Message);
                curMsg = curMethodName + ":Exception=" + ex.Message;
                Log.WriteFile(curMsg);
                returnStatus = false;
            }

            return(returnStatus);
        }
        public ExportScorebookPublishFmt()
        {
            // 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
                {
                    CalcScoreSummary curCalcSummary = new CalcScoreSummary();

                    DataTable curTourDataTable = getTourData(mySanctionNum);
                    if (curTourDataTable.Rows.Count > 0)
                    {
                        myTourRow   = curTourDataTable.Rows[0];
                        myTourRules = (String)myTourRow["Rules"];
                        myTourClass = myTourRow["Class"].ToString().Trim();

                        int curSlalomRounds = 0, curTrickRounds = 0, curJumpRounds = 0;
                        try {
                            curSlalomRounds = Convert.ToInt16(myTourRow["SlalomRounds"].ToString());
                        } catch {
                            curSlalomRounds = 0;
                        }
                        try {
                            curTrickRounds = Convert.ToInt16(myTourRow["TrickRounds"].ToString());
                        } catch {
                            curTrickRounds = 0;
                        }
                        try {
                            curJumpRounds = Convert.ToInt16(myTourRow["JumpRounds"].ToString());
                        } catch {
                            curJumpRounds = 0;
                        }
                        if (curSlalomRounds > myTourRounds)
                        {
                            myTourRounds = curSlalomRounds;
                        }
                        if (curTrickRounds > myTourRounds)
                        {
                            myTourRounds = curTrickRounds;
                        }
                        if (curJumpRounds > myTourRounds)
                        {
                            myTourRounds = curJumpRounds;
                        }

                        AgeGroupDropdownList curAgeGroupDropdownList = new AgeGroupDropdownList(myTourRow);
                        myAgeDivDataTable = curAgeGroupDropdownList.AgeDivDataTable;
                    }
                }
            }
        }
Esempio n. 5
0
        public void navRefresh_Click(object sender, EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;

            // Retrieve data from database
            if (mySanctionNum != null && myEvent != null)
            {
                String           curDataType = "all", curPlcmtMethod = "score";
                String           curPlcmtOrg, curPointsMethod;
                CalcScoreSummary curCalcSummary = new CalcScoreSummary();

                // Retrieve data from database depending on selection criteria
                String curMsg = "Tournament scores retrieved ";

                if (bestScoreButton.Checked)
                {
                    curDataType       = "best";
                    winStatusMsg.Text = curMsg + "- best scores ";
                }
                else if (totalScoreButton.Checked)
                {
                    curDataType       = "total";
                    winStatusMsg.Text = curMsg + "- total scores";
                }
                else if (finalScoreButton.Checked)
                {
                    curDataType       = "final";
                    winStatusMsg.Text = curMsg + "- final scores";
                }
                myTourProperties.TrickTeamSummaryDataType = curDataType;

                if (rawScoreButton.Checked)
                {
                    curPlcmtMethod = "score";
                }
                else if (pointsScoreButton.Checked)
                {
                    curPlcmtMethod = "points";
                }
                else
                {
                    curPlcmtMethod = "score";
                }
                myTourProperties.TrickTeamSummaryPlcmtMethod = curPlcmtMethod;

                if (divPlcmtButton.Checked)
                {
                    curPlcmtOrg     = "div";
                    TeamDiv.Visible = true;
                }
                else if (groupPlcmtButton.Checked)
                {
                    curPlcmtOrg = "group";
                }
                else if (plcmtTourButton.Checked)
                {
                    curPlcmtOrg     = "tour";
                    TeamDiv.Visible = false;
                }
                else
                {
                    curPlcmtOrg     = "tour";
                    TeamDiv.Visible = false;
                }
                myTourProperties.TrickTeamSummaryPlcmtOrg = curPlcmtOrg;

                HCapBase.Visible  = false;
                HCapScore.Visible = false;
                if (nopsPointsButton.Checked)
                {
                    curPointsMethod = "nops";
                }
                else if (plcmtPointsButton.Checked)
                {
                    curPointsMethod = "plcmt";
                    curPlcmtMethod  = "score";
                }
                else if (kBasePointsButton.Checked)
                {
                    curPointsMethod = "kbase";
                }
                else if (handicapPointsButton.Checked)
                {
                    curPointsMethod   = "hcap";
                    HCapBase.Visible  = true;
                    HCapScore.Visible = true;
                }
                else if (ratioPointsButton.Checked)
                {
                    curPointsMethod   = "ratio";
                    HCapBase.Visible  = true;
                    HCapScore.Visible = true;
                }
                else
                {
                    curPointsMethod = "nops";
                }
                myTourProperties.TrickTeamSummaryPointsMethod = curPointsMethod;

                String curGroupValue = "";
                try {
                    curGroupValue = EventGroupList.SelectedItem.ToString();
                    if (!(curGroupValue.ToLower().Equals("all")))
                    {
                        if (myTourRules.ToLower().Equals("ncwsa"))
                        {
                            if (curGroupValue.ToUpper().Equals("MEN A"))
                            {
                                curGroupValue = "CM";
                            }
                            else if (curGroupValue.ToUpper().Equals("WOMEN A"))
                            {
                                curGroupValue = "CW";
                            }
                            else if (curGroupValue.ToUpper().Equals("MEN B"))
                            {
                                curGroupValue = "BM";
                            }
                            else if (curGroupValue.ToUpper().Equals("WOMEN B"))
                            {
                                curGroupValue = "BW";
                            }
                            else
                            {
                                curGroupValue = "All";
                            }
                        }
                    }
                } catch {
                    curGroupValue = "All";
                }

                if (myTourRules.ToLower().Equals("iwwf"))
                {
                    curPointsMethod  = "kbase";
                    myScoreDataTable = curCalcSummary.CalcIwwfEventPlcmts(myTourRow, mySanctionNum, "Trick", myTourRules, curDataType, curPlcmtMethod, curPlcmtOrg, curPointsMethod, "Team", curGroupValue);
                    loadScoreDataGrid(myScoreDataTable);
                    myTeamDataTable = curCalcSummary.getTrickSummaryTeam(myTeamDataTable, myScoreDataTable, myTourRow, myNumPerTeam, curDataType, curPlcmtMethod, curPlcmtOrg, curPointsMethod);
                    if (plcmtTourButton.Checked)
                    {
                        myTeamDataTable = curCalcSummary.CalcTeamCombinedSummary(myTourRow, null, myScoreDataTable, null, myNumPerTeam);
                    }
                }
                else if (myTourRules.ToLower().Equals("ncwsa"))
                {
                    if (plcmtTourButton.Checked)
                    {
                        curPlcmtOrg = "div";
                    }
                    myScoreDataTable = curCalcSummary.getTrickSummary(myTourRow, curDataType, curPlcmtMethod, curPlcmtOrg, curPointsMethod, "Team", curGroupValue);
                    loadScoreDataGrid(myScoreDataTable);
                    myTeamDataTable = curCalcSummary.getTrickSummaryTeam(myScoreDataTable, myTourRow, myNumPerTeam, curDataType, curPlcmtMethod, curPlcmtOrg, curPointsMethod);
                    if (plcmtTourButton.Checked)
                    {
                        myTeamDataTable = curCalcSummary.CalcTeamEventCombinedNcwsaSummary(myTeamDataTable, mySanctionNum);
                    }
                }
                else
                {
                    myScoreDataTable = curCalcSummary.getTrickSummary(myTourRow, curDataType, curPlcmtMethod, curPlcmtOrg, curPointsMethod, "Team", curGroupValue);
                    loadScoreDataGrid(myScoreDataTable);
                    myTeamDataTable = curCalcSummary.getTrickSummaryTeam(myScoreDataTable, myTourRow, myNumPerTeam, curDataType, curPlcmtMethod, curPlcmtOrg, curPointsMethod);
                    if (plcmtTourButton.Checked)
                    {
                        myTeamDataTable = curCalcSummary.CalcTeamCombinedSummary(myTourRow, null, myScoreDataTable, null, myNumPerTeam);
                    }
                }

                String curSortCmd = "";
                if (TeamDiv.Visible)
                {
                    curSortCmd = "DivOrder ASC, Div ASC, TeamScoreTotal DESC";
                }
                else
                {
                    curSortCmd = "TeamScoreTotal DESC";
                }
                myTeamDataTable.DefaultView.Sort = curSortCmd;
                myTeamDataTable = myTeamDataTable.DefaultView.ToTable();
                loadTeamDataGrid(myTeamDataTable);
            }
            this.Cursor = Cursors.Default;
        }
        public void navRefresh_Click(object sender, EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;

            // Retrieve data from database
            if (mySanctionNum != null && myTourRow != null)
            {
                String           curDataType = "all", curPlcmtMethod = "score";
                String           curPlcmtOrg, curPointsMethod;
                CalcScoreSummary curCalcSummary = new CalcScoreSummary();

                // Retrieve data from database depending on selection criteria
                String curMsg = "Tournament scores retrieved ";

                if (bestScoreButton.Checked)
                {
                    curDataType       = "best";
                    winStatusMsg.Text = curMsg + "- best scores ";
                }
                else if (roundScoreButton.Checked)
                {
                    curDataType       = "round";
                    winStatusMsg.Text = curMsg + "- total scores";
                }
                else if (finalScoreButton.Checked)
                {
                    curDataType       = "final";
                    winStatusMsg.Text = curMsg + "- final scores";
                }
                myTourProperties.MasterSummaryOverallDataType = curDataType;

                if (pointsScoreButton.Checked)
                {
                    curPlcmtMethod = "points";
                }
                else if (handicapScoreButton.Checked)
                {
                    curPlcmtMethod = "hcap";
                }
                else if (ratioScoreButton.Checked)
                {
                    curPlcmtMethod = "ratio";
                }
                else
                {
                    curPlcmtMethod = "points";
                }
                myTourProperties.MasterSummaryOverallPlcmtMethod = curPlcmtMethod;

                EventGroup.Visible = false;
                if (groupPlcmtButton.Checked)
                {
                    curPlcmtOrg        = "group";
                    EventGroup.Visible = true;
                }
                else if (plcmtTourButton.Checked)
                {
                    curPlcmtOrg = "tour";
                }
                else if (plcmtDivButton.Checked)
                {
                    curPlcmtOrg = "div";
                }
                else if (plcmtDivGrpButton.Checked)
                {
                    curPlcmtOrg        = "divgr";
                    EventGroup.Visible = true;
                }
                else
                {
                    curPlcmtOrg = "tour";
                }
                myTourProperties.MasterSummaryOverallPlcmtOrg = curPlcmtOrg;

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

                String curFilterSetting = "All";
                if (showAllButton.Checked)
                {
                    curFilterSetting = "All";
                }
                else if (showQlfyButton.Checked)
                {
                    curFilterSetting = "Qualifed";
                }
                else
                {
                    curFilterSetting = "All";
                }
                myTourProperties.MasterSummaryOverallFilter = curFilterSetting;

                /*
                 * if ( EventGroup.Visible ) {
                 *  SlalomLabel.Location = new Point( 208, SlalomLabel.Location.Y );
                 *  TrickLabel.Location = new Point( 573, SlalomLabel.Location.Y );
                 *  JumpLabel.Location = new Point( 830, SlalomLabel.Location.Y );
                 *  OverallLabel.Location = new Point( 1062, SlalomLabel.Location.Y );
                 * } else {
                 *  SlalomLabel.Location = new Point( 168, SlalomLabel.Location.Y );
                 *  TrickLabel.Location = new Point( 533, SlalomLabel.Location.Y );
                 *  JumpLabel.Location = new Point( 790, SlalomLabel.Location.Y );
                 *  OverallLabel.Location = new Point( 1022, SlalomLabel.Location.Y );
                 * }
                 */

                String curGroupValue = "";
                try {
                    curGroupValue = EventGroupList.SelectedItem.ToString();
                    if (!(curGroupValue.ToLower().Equals("all")))
                    {
                        if (myTourRules.ToLower().Equals("ncwsa"))
                        {
                            if (curGroupValue.ToUpper().Equals("MEN A"))
                            {
                                curGroupValue = "CM";
                            }
                            else if (curGroupValue.ToUpper().Equals("WOMEN A"))
                            {
                                curGroupValue = "CW";
                            }
                            else if (curGroupValue.ToUpper().Equals("MEN B"))
                            {
                                curGroupValue = "BM";
                            }
                            else if (curGroupValue.ToUpper().Equals("WOMEN B"))
                            {
                                curGroupValue = "BW";
                            }
                            else
                            {
                                curGroupValue = "All";
                            }
                        }
                    }
                } catch {
                    curGroupValue = "All";
                }


                if (curGroupValue.ToLower().Equals("all"))
                {
                    if (myTourRules.ToLower().Equals("iwwf") && curPointsMethod.ToLower().Equals("kbase"))
                    {
                        mySummaryDataTable = curCalcSummary.CalcIwwfEventPlcmts(myTourRow, mySanctionNum, "Overall", myTourRules, curDataType, curPlcmtMethod, curPlcmtOrg, curPointsMethod, null, null);
                    }
                    else
                    {
                        mySlalomDataTable  = curCalcSummary.getSlalomSummary(myTourRow, curDataType, curPlcmtMethod, curPlcmtOrg, curPointsMethod);
                        myTrickDataTable   = curCalcSummary.getTrickSummary(myTourRow, curDataType, curPlcmtMethod, curPlcmtOrg, curPointsMethod);
                        myJumpDataTable    = curCalcSummary.getJumpSummary(myTourRow, curDataType, curPlcmtMethod, curPlcmtOrg, curPointsMethod);
                        mySummaryDataTable = curCalcSummary.buildOverallSummary(myTourRow, mySlalomDataTable, myTrickDataTable, myJumpDataTable, curDataType, curPlcmtOrg);
                    }
                }
                else
                {
                    if (myTourRules.ToLower().Equals("iwwf") && curPointsMethod.ToLower().Equals("kbase"))
                    {
                        mySummaryDataTable = curCalcSummary.CalcIwwfEventPlcmts(myTourRow, mySanctionNum, "Overall", myTourRules, curDataType, curPlcmtMethod, curPlcmtOrg, curPointsMethod, "All", curGroupValue);
                    }
                    else
                    {
                        mySlalomDataTable  = curCalcSummary.getSlalomSummary(myTourRow, curDataType, curPlcmtMethod, curPlcmtOrg, curPointsMethod, "All", curGroupValue);
                        myTrickDataTable   = curCalcSummary.getTrickSummary(myTourRow, curDataType, curPlcmtMethod, curPlcmtOrg, curPointsMethod, "All", curGroupValue);
                        myJumpDataTable    = curCalcSummary.getJumpSummary(myTourRow, curDataType, curPlcmtMethod, curPlcmtOrg, curPointsMethod, "All", curGroupValue);
                        mySummaryDataTable = curCalcSummary.buildOverallSummary(myTourRow, mySlalomDataTable, myTrickDataTable, myJumpDataTable, curDataType, curPlcmtOrg);
                    }
                }
                loadSummaryDataGrid();
            }
            this.Cursor = Cursors.Default;
        }