// Procède à l'importation des joueurs. private void LoadPlayers() { string query = "select * from players"; using (DataTableReader reader = SqlTools.ExecuteReader(query)) { while (reader.Read()) { // Calcul de la latéralité. string hand = reader.GetString("hand"); bool? isLeftHanded = null; if (!string.IsNullOrWhiteSpace(hand)) { isLeftHanded = hand.Trim().ToUpper() == "L"; } new Player(reader.GetUint64("ID"), reader.GetString("name"), reader.GetString("nationality"), isLeftHanded, reader.GetUint32Null("height"), reader.GetDateTimeNull("date_of_birth"), reader.GetDateTimeNull("date_begin"), reader.GetDateTimeNull("date_end")); _dataLoadingProgressEventHandler?.Invoke(new DataLoadingProgressEvent(100 * ++_currentDataCount / _totalDataCount)); } } // Importation de l'historique des nationalités. query = "select * from players_nat_history order by date_end"; using (DataTableReader reader = SqlTools.ExecuteReader(query)) { while (reader.Read()) { Player.AddNationalitiesHistoryEntry(reader.GetUint64("ID"), reader.GetString("nationality"), reader.GetDateTime("date_end")); _dataLoadingProgressEventHandler?.Invoke(new DataLoadingProgressEvent(100 * ++_currentDataCount / _totalDataCount)); } } }