private void ScoreEntry_Load(object sender, EventArgs e)
        {
            if (Properties.Settings.Default.SlalomEntry_Width > 0) {
                this.Width = Properties.Settings.Default.SlalomEntry_Width;
            }
            if (Properties.Settings.Default.SlalomEntry_Height > 0) {
                this.Height = Properties.Settings.Default.SlalomEntry_Height;
            }
            if (Properties.Settings.Default.SlalomEntry_Location.X > 0
                && Properties.Settings.Default.SlalomEntry_Location.Y > 0) {
                this.Location = Properties.Settings.Default.SlalomEntry_Location;
            }
            myTourProperties = TourProperties.Instance;
            mySortCommand = myTourProperties.RunningOrderSortSlalom;
            int curDelim = mySortCommand.IndexOf( "AgeGroup" );
            if (curDelim < 0) {
            } else if (curDelim > 0) {
                mySortCommand = mySortCommand.Substring( 0, curDelim ) + "DivOrder" + mySortCommand.Substring( curDelim + "AgeGroup".Length );
                myTourProperties.RunningOrderSortSlalom = mySortCommand;
            } else {
                mySortCommand = "DivOrder" + mySortCommand.Substring( "AgeGroup".Length );
                myTourProperties.RunningOrderSortSlalom = mySortCommand;
            }

            ResizeNarrow.Visible = false;
            ResizeNarrow.Enabled = false;
            ResizeWide.Visible = true;
            ResizeWide.Enabled = true;
            ResizeNarrow.Location = ResizeWide.Location;

            EventDelayReasonTextBox.Visible = false;
            EventDelayReasonLabel.Visible = false;
            StartTimerButton.Visible = false;
            PauseTimerButton.Visible = true;
            StartTimerButton.Location = PauseTimerButton.Location;

            String[] curList = { "SkierName", "Div", "DivOrder", "EventGroup", "RunOrder", "TeamCode", "EventClass", "RankingScore", "RankingRating", "HCapBase", "HCapScore", "Status" };
            sortDialogForm = new SortDialogForm();
            sortDialogForm.ColumnListArray = curList;

            filterDialogForm = new Common.FilterDialogForm();
            filterDialogForm.ColumnListArray = curList;

            rerideReasonDialogForm = new RerideReason();
            skierDoneReasonDialogForm = new SkierDoneReason();
            OptUpDialogForm = new SlalomOptUp();
            myCheckEventRecord = new CheckEventRecord();

            // Retrieve data from database
            mySanctionNum = Properties.Settings.Default.AppSanctionNum;
            Cursor.Current = Cursors.WaitCursor;

            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( "ncwsa" ) ) {
                            TeamCode.Visible = true;
                        } else {
                            TeamCode.Visible = false;
                        }
                        if ( (byte)myTourRow["SlalomRounds"] > 0 ) {
                            mySortCommand = myTourProperties.RunningOrderSortSlalom;

                            EventRunInfoLabel.Text = "   Event Start:\n" + "   Event Delay:\n" + "Skiers, Passes:";
                            EventRunInfoData.Text = "";
                            EventRunPerfLabel.Text = "Event Duration:\n" + "Mins Per Skier:\n" + " Mins Per Pass:"******"";

                            //Load round selection list based on number of rounds specified for the tournament
                            roundSelect.SelectList_Load( myTourRow["SlalomRounds"].ToString(), roundSelect_Click );
                            roundActiveSelect.SelectList_LoadHorztl( myTourRow["SlalomRounds"].ToString(), roundActiveSelect_Click );
                            roundActiveSelect.RoundValue = "1";

                            //Load rope length selection list
                            SlalomLineSelect.SelectList_Load( SlalomLineSelect_Change );

                            //Load slalom speed selection list
                            SlalomSpeedSelect.SelectList_Load( SlalomSpeedSelect_Change );

                            mySkierClassList = new ListSkierClass();
                            mySkierClassList.ListSkierClassLoad();
                            scoreEventClass.DataSource = mySkierClassList.DropdownList;
                            scoreEventClass.DisplayMember = "ItemName";
                            scoreEventClass.ValueMember = "ItemValue";
                            myTourClass = myTourRow["Class"].ToString().ToUpper();
                            myClassCRow = mySkierClassList.SkierClassDataTable.Select("ListCode = 'C'")[0];
                            myClassERow = mySkierClassList.SkierClassDataTable.Select("ListCode = 'E'")[0];

                            //Determine required number of judges for event
                            myNumJudges = 5;
                            StringBuilder curSqlStmt = new StringBuilder( "" );
                            curSqlStmt.Append( "Select ListCode, CodeValue, MaxValue, MinValue FROM CodeValueList " );
                            curSqlStmt.Append( "Where ListName = 'SlalomJudgesNum' And ListCode = '" + myTourClass + "' ORDER BY SortSeq" );
                            DataTable curNumJudgesDataTable = getData( curSqlStmt.ToString() );
                            if (curNumJudgesDataTable.Rows.Count > 0) {
                                setShowByNumJudges( Convert.ToInt16( (Decimal)curNumJudgesDataTable.Rows[0]["MaxValue"] ));
                            } else {
                                setShowByNumJudges ( 1 );
                            }
                            if ( myNumJudges > 3 ) {
                                ClassC5JudgeCB.Visible = false;
                                ClassC5JudgeCB.Enabled = false;
                                ClassR3JudgeCB.Visible = true;
                                ClassR3JudgeCB.Enabled = true;
                                ClassR3JudgeCB.Checked = true;
                            } else {
                                ClassC5JudgeCB.Visible = true;
                                ClassC5JudgeCB.Enabled = true;
                                ClassR3JudgeCB.Visible = false;
                                ClassR3JudgeCB.Enabled = false;
                            }

                            //Retrieve and load boat times
                            curSqlStmt = new StringBuilder( "" );
                            curSqlStmt.Append( "SELECT ListCode, ListCodeNum, SortSeq, CodeValue, MinValue, MaxValue, CodeDesc " );
                            curSqlStmt.Append( "FROM CodeValueList WHERE ListName = 'SlalomBoatTime' ORDER BY SortSeq" );
                            myTimesDataTable = getData( curSqlStmt.ToString() );

                            //Retrieve list of approved tournament boats
                            getApprovedTowboats();
                            listApprovedBoatsDataGridView.Visible = false;
                            BoatSelectInfoLabel.Visible = false;

                            //Retrieve and load tournament event entries
                            loadEventGroupList( Convert.ToByte( roundActiveSelect.RoundValue ) );

                            if (ExportLiveWeb.LiveWebLocation.Length > 1) {
                                LiveWebLabel.Visible = true;
                            } else {
                                LiveWebLabel.Visible = false;
                            }

                        } else {
                            MessageBox.Show( "The slalom event is not defined for the active tournament" );
                        }
                    } else {
                        MessageBox.Show( "The active tournament is not properly defined.  You must select from the Administration menu Tournament List option" );
                    }
                }
            }
            Cursor.Current = Cursors.Default;
        }
        private void ScoreEntry_Load(object sender, EventArgs e)
        {
            if (Properties.Settings.Default.JumpEntry_Width > 0) {
                this.Width = Properties.Settings.Default.JumpEntry_Width;
            }
            if (Properties.Settings.Default.JumpEntry_Height > 0) {
                this.Height = Properties.Settings.Default.JumpEntry_Height;
            }
            if (Properties.Settings.Default.JumpEntry_Location.X > 0
                && Properties.Settings.Default.JumpEntry_Location.Y > 0) {
                this.Location = Properties.Settings.Default.JumpEntry_Location;
            }
            myTourProperties = TourProperties.Instance;
            mySortCommand = myTourProperties.RunningOrderSortJump;
            int curDelim = mySortCommand.IndexOf( "AgeGroup" );
            if (curDelim < 0) {
            } else if (curDelim > 0) {
                mySortCommand = mySortCommand.Substring( 0, curDelim ) + "DivOrder" + mySortCommand.Substring( curDelim + "AgeGroup".Length );
                myTourProperties.RunningOrderSortJump = mySortCommand;
            } else {
                mySortCommand = "DivOrder" + mySortCommand.Substring( "AgeGroup".Length );
                myTourProperties.RunningOrderSortJump = mySortCommand;
            }

            ResizeNarrow.Visible = false;
            ResizeNarrow.Enabled = false;
            ResizeWide.Visible = true;
            ResizeWide.Enabled = true;
            ResizeNarrow.Location = ResizeWide.Location;

            EventRunInfoLabel.Text = "   Event Start:\n" + "   Event Delay:\n" + "Skiers, Passes:";
            EventRunInfoData.Text = "";
            EventRunPerfLabel.Text = "Event Duration:\n" + "Mins Per Skier:\n" + " Mins Per Pass:"******"";
            EventDelayReasonTextBox.Visible = false;
            EventDelayReasonLabel.Visible = false;
            StartTimerButton.Visible = false;
            PauseTimerButton.Visible = true;
            StartTimerButton.Location = PauseTimerButton.Location;

            String[] curList = { "SkierName", "Div", "DivOrder", "EventGroup", "RunOrder", "TeamCode", "EventClass", "RankingScore", "RankingRating", "HCapBase", "HCapScore", "Status" };
            sortDialogForm = new SortDialogForm();
            sortDialogForm.ColumnListArray = curList;

            filterDialogForm = new Common.FilterDialogForm();
            filterDialogForm.ColumnListArray = curList;

            eventGroupSelect = new EventGroupSelect();
            rerideReasonDialogForm = new RerideReason();
            skierDoneReasonDialogForm = new SkierDoneReason();

            // Retrieve data from database
            mySanctionNum = Properties.Settings.Default.AppSanctionNum;
            Cursor.Current = Cursors.WaitCursor;

            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( "ncwsa" ) ) {
                            TeamCode.Visible = true;
                        } else {
                            TeamCode.Visible = false;
                        }

                        if ( (byte)myTourRow["JumpRounds"] > 0 ) {
                            mySanctionYear = Convert.ToInt16( mySanctionNum.Substring( 0, 2 ) );

                            //Load round selection list based on number of rounds specified for the tournament
                            roundSelect.SelectList_Load( myTourRow["JumpRounds"].ToString(), roundSelect_Click );
                            roundActiveSelect.SelectList_LoadHorztl( myTourRow["JumpRounds"].ToString(), roundActiveSelect_Click );
                            roundActiveSelect.RoundValue = "1";
                            roundSelect.RoundValue = "1";

                            //Load jump speed selection list
                            JumpSpeedSelect.SelectList_Load( JumpSpeedSelect_Change );

                            //Load ramp height selection list
                            RampHeightSelect.SelectList_Load( RampHeightSelect_Change );

                            mySkierClassList = new ListSkierClass();
                            mySkierClassList.ListSkierClassLoad();
                            scoreEventClass.DataSource = mySkierClassList.DropdownList;
                            scoreEventClass.DisplayMember = "ItemName";
                            scoreEventClass.ValueMember = "ItemValue";

                            myRuleType = ((String)myTourRow["Rules"]).ToUpper();
                            myTourClass = myTourRow["Class"].ToString().ToUpper();
                            myClassCRow = mySkierClassList.SkierClassDataTable.Select("ListCode = 'C'")[0];
                            myClassERow = mySkierClassList.SkierClassDataTable.Select("ListCode = 'E'")[0];
                            myAgeDivList = new AgeGroupDropdownList( myTourRow );

                            //Setup for meter input if using meters to calculate distances
                            NumJudges = Convert.ToInt16( myTourProperties.JumpEntryNumJudges);
                            if ( NumJudges > 0 ) {
                                JumpCalcMetersCB.Checked = true;
                                JumpCalcVideoCB.Checked = false;
                            } else {
                                JumpCalcMetersCB.Checked = false;
                                JumpCalcVideoCB.Checked = true;
                            }

                            //Retrieve boat times
                            StringBuilder curSqlStmt = new StringBuilder( "" );
                            curSqlStmt.Append( "SELECT ListCode, CodeValue, MinValue, MaxValue, CodeDesc FROM CodeValueList WHERE ListName = 'JumpBoatTime3Seg' ORDER BY SortSeq" );
                            myTimesDataTable = getData( curSqlStmt.ToString() );

                            //Retrieve maximum speeds by age group
                            getMaxSpeedData();

                            //Retrieve minimum speeds by class
                            getMinSpeedData();

                            //Retrieve maximum ramp heights by age group
                            getMaxRampData();

                            //Retrieve list of divisions and scores that require 3 segment validation for L and R tournaments
                            try {
                                DataTable curTourClassDataTable = mySkierClassList.getTourClassList();
                                myClassRow = curTourClassDataTable.Select( "ListCode = '" + myTourClass + "'" )[0];
                                if ((Decimal)myClassRow["ListCodeNum"] > (Decimal)myClassERow["ListCodeNum"]) {
                                    getJump3TimesDivData();
                                } else {
                                    myJump3TimesDivDataTable = null;
                                }
                            } catch {
                                myJump3TimesDivDataTable = null;
                            }

                            //Get list of approved tow boats
                            getApprovedTowboats();
                            BoatSelectInfoLabel.Visible = false;
                            listApprovedBoatsDataGridView.Visible = false;

                            //Retrieve and load tournament event entries
                            loadEventGroupList( Convert.ToByte( roundActiveSelect.RoundValue ) );

                            if (ExportLiveWeb.LiveWebLocation.Length > 1) {
                                LiveWebLabel.Visible = true;
                            } else {
                                LiveWebLabel.Visible = false;
                            }
                        } else {
                            MessageBox.Show( "The jump event is not defined for the active tournament" );
                        }
                    } else {
                        MessageBox.Show( "The active tournament is not properly defined.  You must select from the Administration menu Tournament List option" );
                    }
                }
            }
            Cursor.Current = Cursors.Default;
        }