Ejemplo n.º 1
0
        // GET: Sections/SaveSection
        public IActionResult SaveSection(int tournamentId)
        {
            SectionVm  viewModel  = new SectionVm();
            Tournament tournament = _tournamentManagement.GetTournamentById(tournamentId);

            viewModel.TournamentId = tournament.TournamentId;
            viewModel.Tournament   = tournament;
            return(View("SectionAdminForm", viewModel));
        }
        public IActionResult Index(int tournamentId)
        {
            TournamentAdministratorVm viewModel = new TournamentAdministratorVm(_tournamentManagement.GetTournamentById(tournamentId));

            viewModel.AdminUsers     = _tournamentAdministratorManagement.GetTournamentAdministrators(tournamentId);
            viewModel.AvailableUsers = _tournamentAdministratorManagement.GetAvailableUsers(tournamentId, viewModel.AdminUsers);

            return(View("Index", viewModel));
        }
Ejemplo n.º 3
0
        // GET: Teams/SaveTeam/5
        public IActionResult SaveTeam(int sectionId)
        {
            TeamVm viewModel = new TeamVm();
            var    section   = _sectionManagement.GetSectionById(sectionId);

            viewModel.Section            = section;
            viewModel.SectionId          = section.SectionId;
            viewModel.Section.Tournament = _tournamentManagement.GetTournamentById(section.TournamentId);

            return(View("TeamAdminForm", viewModel));
        }
        // GET: TournamentSquashVenues
        public IActionResult Index(int tournamentId)
        {
            TournamentSquashVenueVm viewModel = new TournamentSquashVenueVm(_tournamentManagement.GetTournamentById(tournamentId));

            viewModel.SquashVenues          = _tournamentSquashVenueManagement.GetTournamentSquashVenues(tournamentId);
            viewModel.AvailableSquashVenues = _tournamentSquashVenueManagement.GetAvailableSquashVenues(tournamentId);

            return(View("Index", viewModel));
        }
        public void AddTournamentSquashVenue(int tournamentId, int squashVenueId)
        {
            Tournament            t  = _tournamentManagement.GetTournamentById(tournamentId);
            SquashVenue           sv = _squashVenueManagement.GetSquashVenueById(squashVenueId);
            TournamentSquashVenue tournamentSquashVenue = new TournamentSquashVenue()
            {
                Tournament  = t,
                SquashVenue = sv
            };

            _context.Add(tournamentSquashVenue);
            _context.SaveChanges();
        }
Ejemplo n.º 6
0
        // GET: Tournament/SaveTeam/5
        public IActionResult Edit(int id)
        {
            if (id == 0)
            {
                return(NotFound());
            }

            var          tournament = _tournamentManagement.GetTournamentById(id);
            TournamentVm viewModel  = new TournamentVm(tournament)
            {
                Sections = _sectionManagement.GetSectionsForTournament(tournament.TournamentId)
            };

            return(View("TournamentAdminForm", viewModel));
        }
Ejemplo n.º 7
0
        public FixtureIndexVm FixtureIndexViewModel(int sectionId)
        {
            //clean up here please :-)

            FixtureIndexVm viewModel = new FixtureIndexVm();

            viewModel.SectionVm            = new SectionVm(_sectionManagement.GetSectionById(sectionId));
            viewModel.SectionVm.Tournament = _tournamentManagement.GetTournamentById(viewModel.SectionVm.TournamentId);


            foreach (var fixture in GetFixturesForSection(sectionId))
            {
                FixtureVm fixtureVm = new FixtureVm(fixture);
                fixtureVm.TeamA   = _teamManagement.GetTeamById(fixture.TeamAId);
                fixtureVm.TeamB   = _teamManagement.GetTeamById(fixture.TeamBId);
                fixtureVm.Section = _sectionManagement.GetSectionById(fixture.SectionId);
                fixtureVm.TournamentSquashVenue = _tournamentSquashVenueManagement.GetTournamentSquashVenueById(fixture.TournamentSquashVenueId);

                viewModel.FixtureVms.Add(fixtureVm);
            }

            return(viewModel);
        }