Example #1
0
 double GetExactaPayout(SippHorse firstHorse, SippHorse secondHorse)
 {
     Debug.Assert(null != _oddsRetriever);
     int h1 = firstHorse.ProgramNumberWithoutEntryChar;
     int h2 = secondHorse.ProgramNumberWithoutEntryChar;
     DataTable dt = _oddsRetriever.ExactaPayouts;
     Debug.Assert(null != dt);
     return (double)dt.Rows[h1 - 1][h2 - 1];
 }
Example #2
0
        public void Bind(SippRace race)
        {
            _selectedHorse = null;
            _oddsRetriever = null;

            _toolButonStartRealTimeOdds.Enabled = true;
            _toolButonShowDoublePool.Enabled = false;
            _toolButonExactas.Enabled = false;
            _toolButonBreadAndButer.Enabled = false;
            _toolButonShowHandicappingFactors.Enabled = true;
            _toolButonCompareJockeys.Enabled = true;
            _underlinedFont = new Font(_gridPP.DefaultCellStyle.Font, FontStyle.Underline);
            _boldFont = new Font(_gridPP.DefaultCellStyle.Font.FontFamily, _gridPP.DefaultCellStyle.Font.Size, FontStyle.Bold);
            _race = race;
            UpdateScreen();
        }
Example #3
0
 public void Clear()
 {
     _grid.Rows.Clear();
     _grid.Columns.Clear();
     _labelCondition.Text = "";
     _labelRaceNumber.Text = "";
     _labelSelectedHorseName.Text = "";
     _labelSelectedHorseNumber.Text = "";
     _toolButonShowDoublePool.Enabled = false;
     _toolButonExactas.Enabled = false;
     _toolButonStartRealTimeOdds.Enabled = false;
     _toolButonBreadAndButer.Enabled = false;
     _toolButonShowHandicappingFactors.Enabled = false;
     _toolButonCompareJockeys.Enabled = false;
     _toolButonShowSpeedFigures.Enabled = false;
     _tbAverage.Text = "";
     _tbMin.Text = "";
     _tbMax.Text = "";
     _tbStdev.Text = "";
     _tbTrainerStats.Text = "";
     _tbJockeyStats.Text = "";
     _tbJockeyTrainerStats.Text = "";
     _tbJockeySummarizedStats.Text = "";
     _txtboxBrisRunStyle.Text = "";
     _txtboxClaimingPrice.Text = "";
     _txtboxColorSexAge.Text = "";
     _txtboxOwner.Text = "";
     _txtboxOwnersSilks.Text = "";
     _txtboxQuirinSpeedIndex.Text = "";
     _txtboxPostPosition.Text = "";
     _txtBoxMorningLine.Text = "";
     _txtboxDamInfo.Text = "";
     _txtboxSireInfo.Text = "";
     _tbPastPerformancesHeader.Text = "";
     _tbCurrentWinOdds.Text = "";
     _tbCurrentExactaOdds.Text = "";
     _tbCurrentDoubleOdds.Text = "";
     _gridHandicappingFactors.BorderStyle = BorderStyle.None;
     _gridJockeyStats.BorderStyle = BorderStyle.None;
     _gridSummarizeStats.BorderStyle = BorderStyle.None;
     _grid.BorderStyle = BorderStyle.None;
     _selectedHorse = null;
     UpdateViewType();
 }
Example #4
0
 private void PaintRowForScratchedHorse(SippHorse horse)
 {
     foreach (DataGridViewRow row in _grid.Rows)
     {
         var h = row.Tag as SippHorse;
         if(null != h && h == horse && h.Scratched)
         {
             row.DefaultCellStyle.BackColor = Color.Black;
             row.DefaultCellStyle.SelectionBackColor = Color.Black;
             return;
         }
     }
 }
Example #5
0
        private void LoadSummarizedStats(SippHorse horse)
        {
            _gridSummarizeStats.Rows.Clear();
            _gridSummarizeStats.Columns.Clear();
            _gridSummarizeStats.Columns.Add("Stat", "Stats");
            _gridSummarizeStats.Rows[_gridSummarizeStats.Rows.Add()].Cells[0].Value = horse.LifeTimeRecord;
            _gridSummarizeStats.Rows[_gridSummarizeStats.Rows.Add()].Cells[0].Value = horse.CurrentYearRecord;
            _gridSummarizeStats.Rows[_gridSummarizeStats.Rows.Add()].Cells[0].Value = horse.PreviousYearRecord;
            _gridSummarizeStats.Rows[_gridSummarizeStats.Rows.Add()].Cells[0].Value = horse.WetTrackRecord;
            _gridSummarizeStats.Rows[_gridSummarizeStats.Rows.Add()].Cells[0].Value = horse.TurfTrackRecord;
            _gridSummarizeStats.Rows[_gridSummarizeStats.Rows.Add()].Cells[0].Value = horse.TodaysTrackRecord;
            _gridSummarizeStats.Rows[_gridSummarizeStats.Rows.Add()].Cells[0].Value = horse.TodaysDistanceRecord;

            _gridSummarizeStats.BorderStyle = BorderStyle.None;

            _tbTrainerStats.Text = horse.TrainerStatistics;
            _tbJockeyStats.Text = horse.JockeyStatistics;
            _tbJockeyTrainerStats.Text = horse.JockeyTrainerStatistics;

            _tbJockeySummarizedStats.Text = horse.Jockey;
            _gridJockeyStats.Rows.Clear();
            _gridJockeyStats.Columns.Clear();
            _gridJockeyStats.Columns.Add("Name", "Name");
            _gridJockeyStats.Columns.Add("Stats", "Stats");

            _gridJockeyStats.Columns[0].Width = 80;
            _gridJockeyStats.Columns[1].Width = 170;

            foreach (var s in _race.Parent.GetJockeySummarizedStatistics(horse.Jockey))
            {
                var cells = _gridJockeyStats.Rows[_gridJockeyStats.Rows.Add()].Cells;
                cells[0].Value = s.Name;
                cells[1].Value = s.ToString();
            }
        }
Example #6
0
        private void LoadBreedingInfo(SippHorse horse)
        {
            _gridBreedingInfo.Columns.Clear();

            _gridBreedingInfo.Columns.Add("S-DS", "S-DS");
            _gridBreedingInfo.Columns.Add("Name", "Name");
            _gridBreedingInfo.Columns.Add("FTS", "FTS");
            _gridBreedingInfo.Columns.Add("MUD", "MUD");
            _gridBreedingInfo.Columns.Add("TURF", "TURF");
            _gridBreedingInfo.Columns.Add("AWS", "AWS");
            _gridBreedingInfo.Columns.Add("DIST", "DIST");

            int index = _gridBreedingInfo.Rows.Add();

            var boldFont = new Font(_gridBreedingInfo.DefaultCellStyle.Font, FontStyle.Bold);
            _gridBreedingInfo.Rows[index].DefaultCellStyle.Font = boldFont;
            _gridBreedingInfo["FTS", index].Value = "FTS";
            _gridBreedingInfo["MUD", index].Value = "M";
            _gridBreedingInfo["TURF", index].Value = "T";
            _gridBreedingInfo["AWS", index].Value = "AWS";
            _gridBreedingInfo["DIST", index].Value = "D";

            foreach (var sire in new List<SippSire> {horse.Sire, horse.DamSire})
            {
                if(null == sire)
                    continue;

                index = _gridBreedingInfo.Rows.Add();
                DataGridViewCellCollection cells = _gridBreedingInfo.Rows[index].Cells;

                cells[0].Value = (sire == horse.Sire ? "S" : "DS");
                cells[0].Style.Font = boldFont;
                cells[1].Value = sire.Name;
                cells[2].Value = sire.FirstTimeOutRating;
                cells[3].Value = sire.MudRating;
                cells[4].Value = sire.TurfRating;
                cells[5].Value = sire.AllWeatherRating;
                cells[6].Value = sire.AverageDistance;
            }

            for (int i = 0; i < _gridBreedingInfo.Columns.Count; ++i)
            {
                _gridBreedingInfo.Columns[i].SortMode = DataGridViewColumnSortMode.NotSortable;
            }

            _gridBreedingInfo.BorderStyle = BorderStyle.None;
            _gridBreedingInfo.CellBorderStyle = DataGridViewCellBorderStyle.None;
            _gridBreedingInfo.DefaultCellStyle.BackColor = Color.Beige;
            _gridBreedingInfo.DefaultCellStyle.SelectionBackColor = Color.Beige;
            _gridBreedingInfo.RowHeadersVisible = false;
            _gridBreedingInfo.ColumnHeadersVisible = false;

            _gridBreedingInfo.BackgroundColor = Color.Beige;
        }
Example #7
0
        public void ToggleHorseStatus(SippHorse horse)
        {
            if (null != horse)
            {
                horse.IsContender = !horse.IsContender;
            }

            PaintHorseNameBasedInContenterAndScratchedStatus();
        }
Example #8
0
        public void DisplayHorseInfo(SippHorse horse)
        {
            _labelSelectedHorseNumber.Text = horse.ProgramNumber;

            _labelSelectedHorseNumber.BackColor = SippExtentions.SaddleClothBackColor(horse.ProgramNumberWithoutEntryChar);
            _labelSelectedHorseNumber.ForeColor = SippExtentions.SaddleClothFrontColor(horse.ProgramNumberWithoutEntryChar);

            _labelSelectedHorseName.Text = string.Format("{0}  {1} ({2} - {3})", horse.Name, horse.MedicationAndWeight, horse.Jockey,horse.Trainer);

            _txtboxBrisRunStyle.Text = horse.RunningStyle;

            if (horse.ClaimingPrice > 0)
                _txtboxClaimingPrice.Text = "$ " + horse.ClaimingPrice.ToString("#,##0");
            else
                _txtboxClaimingPrice.Text = "";

            _txtboxColorSexAge.Text = horse.ColorAgeAndSex;
            _txtboxOwner.Text = horse.Owner;
            _txtboxOwnersSilks.Text = horse.OwnerSilks;
            _txtboxQuirinSpeedIndex.Text = horse.QuirinSpeedPoints.ToString();
            _txtboxSireInfo.Text = horse.SireName;
            _txtboxDamInfo.Text = horse.Dam;
            _txtboxPostPosition.Text = "";
            _txtboxPostPosition.Text = horse.PostPosition.ToString();
            _tbCurrentWinOdds.Text = horse.CurrentOddsFromWin;
            _tbCurrentExactaOdds.Text = horse.CurrentOddsFromExacta;
            _tbCurrentDoubleOdds.Text = horse.CurrentOddsFromDouble;

            var odds = SippOdds.Make("1");
            odds.SetOddsToOne(horse.MorningLineOdds);

            _txtBoxMorningLine.Text = odds.ToString();

            _gridHandicappingFactors.Rows.Clear();
            _gridHandicappingFactors.Columns.Clear();

            _gridHandicappingFactors.Columns.Add("Name", "Name");
            _gridHandicappingFactors.Columns.Add("General", "General");
            _gridHandicappingFactors.Columns.Add("Trainer", "Trainer");

            foreach (var hp in horse.HandicappingFactors)
            {
                int rowindex = _gridHandicappingFactors.Rows.Add();
                var cells = _gridHandicappingFactors.Rows[rowindex].Cells;

                cells[0].Value = hp.Name;
                cells[1].Value = hp.GeneralStats.ToString();
                cells[2].Value = hp.TrainerStats.ToString();

                cells[0].Style.Font = new Font("Microsoft Sans Serif", 8.25F,FontStyle.Bold);
            }

            _gridHandicappingFactors.Columns[0].Width = 180;
            _gridHandicappingFactors.Columns[1].Width = 150;
            _gridHandicappingFactors.Columns[2].Width = 150;
            _gridHandicappingFactors.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;

            _tbPastPerformancesHeader.Text = string.Format("Past Performances [ {0} ]", horse.Name);
            _gridPP.DataSource = horse.PastPerformances;

            _gridPP.Columns["SurfaceAndDistanceType"].Visible = false;
            _gridPP.Columns["DistanceInYards"].Visible = false;
            _gridPP.Columns["AboutDistanceFlag"].Visible = false;
            _gridPP.Columns["WinnersFinalTime"].Visible = false;
            _gridPP.Columns["ThisHorseFinalTime"].Visible = false;
            _gridPP.Columns["NormalFigureColor"].Visible = false;
            _gridPP.Columns["Parent"].Visible = false;

            HighlightPPGrid();
            LoadBreedingInfo(horse);
            LoadSummarizedStats(horse);

            _selectedHorse = horse;
        }