Пример #1
0
 private void PopulateDataGridStart()
 {
     foreach (var runner in _runnerManager.GetDictionaryOFRunners())
     {
         dtGrdVwMainRaceForm.Rows.Add(_runnerManager.KeyValueToString(runner.Key),
                                      runner.Value.GetFinishedLapsTimeList().Last().ToString()
                                      );
     }
 }
Пример #2
0
 private void PopulateDataGrid()
 {
     foreach (var runner in _runnerManager.GetDictionaryOFRunners())
     {
         dtGrdRegisteredRunnersVw.Rows.Add(_runnerManager.KeyValueToString(runner.Key),
                                           runner.Value.Name,
                                           _stateManager.GetStateBykey(runner.Value.StateOfOrigin).SlovakShortName,
                                           runner.Value.Age,
                                           runner.Value.Sex);
     }
 }
Пример #3
0
        private void LoadFile()
        {
            if (openFileDialog.ShowDialog() == DialogResult.OK)
            {
                string strfilename = openFileDialog.InitialDirectory + openFileDialog.FileName;
                try
                {
                    _fileRepository.LoadDataFromFile(strfilename);
                    _runnerManager = new RunnerManager(_fileRepository);
                    _raceManager   = new RaceManager(_fileRepository);
                    race           = _fileRepository.GetRace();
                    form           = new RunnersForm(_runnerManager, _stateManager);
                    if (race.LengthOfLap != 0)
                    {
                        nmrcUpDwnLengthOfLap.Text     = race.LengthOfLap.ToString();
                        nmrcUpDwnNumberOfLaps.Text    = race.NumberOfLaps.ToString();
                        nmrcUpDwnNumberOfWinners.Text = race.NumberOfWinners.ToString();
                        SetBttnsAndTextAtStartRace();
                        lblRaceStartTime.Text = _runnerManager.GetDictionaryOFRunners().Values.ElementAt(0).GetFinishedLapsTimeList()[0].ToString();

                        foreach (var runner in _runnerManager.GetDictionaryOFRunners())
                        {
                            dtGrdVwMainRaceForm.Rows.Add(_runnerManager.KeyValueToString(runner.Key),
                                                         runner.Value.GetFinishedLapsTimeList().Last().ToString(), runner.Value.CountTimeTotal().ToString());
                        }
                        foreach (var runner in _runnerManager.GetDictionaryOFRunners())
                        {
                            _raceManager.IsFinishedRunnerAddedToWinningDirectory(race.NumberOfLaps, runner.Key, runner.Value);
                        }
                        PopulateDtGrdVwFinishedRunners();
                    }
                }
                catch (InvalidOperationException e)
                {
                    MessageBox.Show("Could not open the file " + e.Message);
                }
            }
        }