示例#1
0
        public string GetDetails(round round)
        {
            if (string.IsNullOrEmpty(master.SD) || master.SD == "1")
            {
                return GetExpandedDetails(round);
            }

            return "";
        }
示例#2
0
        public string CheckIfCut(round round)
        {
            if (round.isquarter == 1)
            {
                return "<br /><br />";
            }

            return "";
        }
示例#3
0
        private string GetExpandedDetails(round round)
        {
            player player1 = entity.players.FirstOrDefault(player => player.id == round.player1);
            player player2 = entity.players.FirstOrDefault(player => player.id == round.player2);

            if (player1 == null) return "";
            deck player1Deck = player1.decks
                .FirstOrDefault(deck => deck.round == round.roundnum && deck.@event == round.eventid);

            if (player2 == null) return "";
            deck player2Deck = player2.decks
                .FirstOrDefault(deck => deck.round == round.roundnum && deck.@event == round.eventid);

            if (player1Deck == null) return "";

            if (player2Deck == null) return "";

            StringBuilder sb = new StringBuilder();
            sb.Append(player1.name.TrimEnd()).Append(" (");

            if (!string.IsNullOrEmpty(player1Deck.link))
            {
                sb.Append("<a href=")
                    .Append("'")
                    .Append(player1Deck.link.TrimEnd())
                    .Append("' target='_blank'>")
                    .Append(player1Deck.name.TrimEnd())
                    .Append("</a>");
            }
            else
            {
                sb.Append(player1Deck.name.TrimEnd());
            }

            sb.Append(") vs ").Append(player2.name.TrimEnd()).Append(" (");

            if (!string.IsNullOrEmpty(player2Deck.link))
            {
                sb.Append("<a href=")
                    .Append("'")
                    .Append(player2Deck.link.TrimEnd())
                    .Append("' target='_blank'>")
                    .Append(player2Deck.name.TrimEnd())
                    .Append("</a>");
            }
            else
            {
                sb.Append(player2Deck.name.TrimEnd());
            }

            sb.Append(")");

            return sb.ToString();
        }
示例#4
0
        public string GetStreamSource(round round)
        {
            string streamSource = "";
            if (round.link.Contains("youtube"))
            {
                streamSource = "../Images/youtube.png";
            }
            else if (round.link.Contains("twitch"))
            {
                streamSource = "../Images/twitch.png";
            }
            else
            {
                streamSource = "../Images/twitch.png";
            }

            return streamSource;
        }
示例#5
0
 public string GetRoundNum(round round)
 {
     if (round.isfinals == 1)
     {
         return "Finals";
     }
     else if (round.isquarter == 1)
     {
         return "Quarterfinals";
     }
     else if (round.issemi == 1)
     {
         return "Semifinals";
     }
     else
     {
         return "Round " + round.roundnum;
     }
 }
示例#6
0
        public string GetRound(round round)
        {
            string link = "";

            link = "<a href='" + round.link.TrimEnd() + "' target='_newtab' >Round" + round.roundnum + "</a><br>";

            return link;
        }