Example #1
0
 public BrisRace(int raceNumber, BrisDailyCard parent)
 {
     _parent = parent;
     _raceNumber = raceNumber;
 }
Example #2
0
        private void Initialize()
        {
            var bdc = new BrisDailyCard(_brisAbrvTrackCode, Date);
            int year = Convert.ToInt32(Date.Substring(0, 4));
            string filename = Utilities.GetBrisPastPerformancesFilename(year, _brisAbrvTrackCode + Date.Substring(4));
            bdc.Load(filename);
            _correspondingBrisDailyCard = bdc;
            bdc.CorrespondingDailyCard = this;

            foreach (Race race in _race)
            {
                race.Parent = this;
                race.InitializeHorses(bdc.GetRaceByItsProgramNumber(race.RaceNumber));
            }

            AssignWinnersFromDb();
            AssignRaceIDFromDb();
            if (ExistsInDb)
            {
                AssignFinalOddsFromDb();
            }
        }
Example #3
0
        private void LoadFromBrisFile(string filename)
        {
            string year = GetYearFromFullPathOfBrisFile(filename);

            string temp;
            if (filename.IndexOf("DRF") >= 0)
            {
                temp = Path.GetFileName(filename).ToUpper().Replace(".DRF", "");
            }
            else if (filename.IndexOf("MCP") >= 0)
            {
                temp = Path.GetFileName(filename).ToUpper().Replace(".MCP", "");
            }
            else
            {
                throw new Exception("Invalid File Name: " + filename);
            }

            _brisAbrvTrackCode = temp.Substring(0, 3);
            _date = year + temp.Substring(3);
            _race.Clear();

            var rc = new BrisDailyCard(_brisAbrvTrackCode, _date);
            rc.Load(filename);

            List<int> rn = rc.GetProgramNumbersForAllRaces();

            foreach (int raceNumber in rn)
            {
                BrisRace brisRace = rc.GetRaceByItsProgramNumber(raceNumber);

                _race.Add(Race.MakeRaceFromBrisRace(brisRace));
            }
        }
        private void ProcessFile(string filename)
        {
            UpdateObserver(string.Format("Processing file {0}", filename));
            DailyCard dc = DailyCard.Load(filename);
            dc.UpdateScratchesFromDb();

            BrisDailyCard bdc = new BrisDailyCard(dc.BrisAbrvTrackCode, dc.Date);

            //string brisfilename = Hogar.Utilities.PastPerformancesDirectory + @"\" + dc.RaceTrack + dc.Date + ".DRF";
            int year = Convert.ToInt32(dc.Date.Substring(0, 4));
            string brisfilename = Utilities.GetBrisPastPerformancesFilename(year, dc.BrisAbrvTrackCode + dc.Date.Substring(4));
            bdc.Load(brisfilename);

            foreach (Race race in dc.Races)
            {
                BrisRace brisRace = bdc.GetRaceByItsProgramNumber(race.RaceNumber);
                for (int constant = _min; constant < _max; constant+=_step)
                {
                    ProcessRace(race, constant, brisRace,filename);
                }
            }
        }