private string GetEventPlayer(int?playerID) { string fullName = string.Empty; if (playerID != null && playerID > 0) { PlayerOfMatch player = PlayersOfMatch?.FirstOrDefault(x => x.PlayerOfMatchID == playerID); fullName = player?.FirstName + " " + player?.LastName; } return(fullName.Trim()); }
private void SetPlayerInRowByPlayingStatus(PlayersInRow playersInRow, PlayerOfMatch playerOfMatch) { if (playerOfMatch.TeamName?.Trim() == Match?.HomeTeam?.Trim()) { playersInRow.FirstPlayer = playerOfMatch; } if (playerOfMatch.TeamName?.Trim() == Match?.AwayTeam?.Trim()) { playersInRow.SecondPlayer = playerOfMatch; } ; }
private PlayersInRow CreatePlayerInRow(ObservableCollection <PlayerOfMatch> biggerList, ObservableCollection <PlayerOfMatch> smallerList, int index) { PlayerOfMatch playerOfMatch = biggerList[index]; PlayersInRow playersInRow = new PlayersInRow(); playersInRow.PlayingStatus = playerOfMatch.PlayingStatus; SetPlayerInRowByPlayingStatus(playersInRow, playerOfMatch); if (index < smallerList.Count) { playerOfMatch = smallerList[index]; SetPlayerInRowByPlayingStatus(playersInRow, playerOfMatch); } return(playersInRow); }