Tournament Dashboard fixed, started to wire up tournamentviewer form

This commit is contained in:
2020-04-12 21:17:01 +02:00
parent dee234408d
commit 8d3e6fdfa4
11 changed files with 294 additions and 29 deletions

View File

@ -12,12 +12,16 @@ namespace TrackerLibrary.Models
/// <summary>
/// The unique identifier for the matchup
/// </summary>
public int Id { get; set; }
public int Id { get; set; }
/// <summary>
/// The set of teams that were involved in this match.
/// </summary>
public List<MatchupEntryModel> Entries { get; set; } = new List<MatchupEntryModel>();
/// <summary>
/// The Id from database that will be used to lookup the winner
/// </summary>
public int WinnerId { get; set; }
/// <summary>
/// The winner of the match.
/// </summary>
public TeamModel Winner { get; set; }
@ -25,5 +29,34 @@ namespace TrackerLibrary.Models
/// Which round this match is a part of.
/// </summary>
public int MatchupRound { get; set; }
public string DisplayName
{
get
{
string output = "";
foreach (MatchupEntryModel me in Entries)
{
if (me.TeamCompeting != null)
{
if (output.Length == 0)
{
output = me.TeamCompeting.TeamName;
}
else
{
output += $" vs. {me.TeamCompeting.TeamName}";
}
}
else
{
output = "Matchup not yet Determined";
break;
}
}
return output;
}
}
}
}