private void Initialize(string configFileName) { try { var config = Config.Load(configFileName); string validationText = config.ValidateErrors(); if (validationText == null) { m_currentConfig = config; competitionCode.Text = config.CompetitionCode; m_db = new Database(m_currentConfig); m_scoresRepo = new QualificationScoresRepo(m_db); m_tournamentRepo = new TournamentRepo(m_db); m_Writer = WriterFactory.GetWriter(m_currentConfig); GenerateNow.Enabled = true; startPublishing.Enabled = true; } else { MessageBox.Show($"Config file validation failed.\r\n{validationText}"); } } catch (Exception ex) { MessageBox.Show($"Unable to open file.\n\r{ex.ToString()}"); } }
public QualificationScoresReportService( QualificationScoresRepo _scoresRepo, TournamentRepo _tournamentRepo) { m_scoresRepo = _scoresRepo; m_tournamentRepo = _tournamentRepo; }