Tournament Dashboard fixed, started to wire up tournamentviewer form
This commit is contained in:
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user