Ejemplo n.º 1
0
        public ActionResult ViewTournament(int id)
        {
            TeamDbHandler       teamdb = new TeamDbHandler();
            List <Team>         teams  = teamdb.GetTeams();
            TournamentDbHandler tdb    = new TournamentDbHandler();

            ViewBag.TournamentID = id;
            List <Match> matches = tdb.ViewTournament(id);

            foreach (Match m in matches)
            {
                foreach (Team t in teams)
                {
                    if (m.Team1ID == t.TeamID)
                    {
                        m.Team1 = t;
                    }
                    else if (m.Team2ID == t.TeamID)
                    {
                        m.Team2 = t;
                    }
                }
            }
            return(View(matches));
        }
Ejemplo n.º 2
0
        public ActionResult ViewTeam(int id)
        {
            TeamDbHandler tbd = new TeamDbHandler();

            return(View(tbd.ViewTeam(id)));
        }
Ejemplo n.º 3
0
        // GET: Team
        public ActionResult Index()
        {
            TeamDbHandler tdb = new TeamDbHandler();

            return(View(tdb.GetTeams()));
        }