Beispiel #1
0
        public IActionResult List()
        {
            OperationResultListVo <TeamViewModel> serviceResult = teamAppService.GetAll(CurrentUserId);

            List <TeamViewModel> model = serviceResult.Value.ToList();

            return(PartialView("_List", model));
        }
Beispiel #2
0
 public async Task <IEnumerable <TeamViewModel> > Get()
 {
     return(await _teamAppService.GetAll());
 }
Beispiel #3
0
        // GET: Team
        public ActionResult Index()
        {
            //################################################# OITAVAS DE FINAL ############################################

            _teamAppService.Add(new Team("Brasil", "BRA"));
            _teamAppService.Add(new Team("Argentina", "ARG"));
            _teamAppService.Add(new Team("Uruguai", "URU"));
            _teamAppService.Add(new Team("Colombia", "COL"));
            _teamAppService.Add(new Team("Paraguai", "PAR"));
            _teamAppService.Add(new Team("Alemanha", "ALE"));
            _teamAppService.Add(new Team("Holanda", "HOL"));
            _teamAppService.Add(new Team("Espanha", "ESP"));
            _teamAppService.Add(new Team("Inglaterra", "ING"));
            _teamAppService.Add(new Team("Belgica", "BEL"));
            _teamAppService.Add(new Team("Croacia", "CRO"));
            _teamAppService.Add(new Team("Italia", "ITA"));
            _teamAppService.Add(new Team("Marrocos", "MAR"));
            _teamAppService.Add(new Team("Nigeria", "NIG"));
            _teamAppService.Add(new Team("Mexico", "Mex"));
            _teamAppService.Add(new Team("Costa Rica", "COS"));

            // LISTA DE SELECOES OITAVAS DE FINAL - SORTEIO
            var selections = _teamAppService.GetAll().ToList();
            var selectionsRafflesOctavesFinals = _rafflesAppService.RafflesOctavesFinal(selections);

            // CONFRONTOS OITAVAS DE FINAL
            var resultOctavesFinal = _matchAppService.PlayOctavesFinal(selectionsRafflesOctavesFinals);

            // VENCEDORES OITAVAS DE FINAL
            ViewBag.resultOctavesFinal = resultOctavesFinal;
            var winnersOctaves       = resultOctavesFinal.Values.ElementAt(0);
            var disqualifiedsOctaves = resultOctavesFinal.Values.ElementAt(1);

            //################################################# QUARTAS DE FINAL ##############################################

            ViewBag.classifiedSelectionsForQuarterFinals = resultOctavesFinal;

            // VENCEDORES DAS OITAVAS DE FINAL - SORTEIO
            var selectionsRafflesQuarterFinals = _rafflesAppService.RafflesQuarterFinal(winnersOctaves);

            ViewBag.selectionsRafflesQuarterFinals = selectionsRafflesQuarterFinals;

            // CONFRONTOS QUARTAS DE FINAL
            var classifiedSelectionsForSemiFinal = _matchAppService.PlayQuarterFinal(selectionsRafflesQuarterFinals);

            // VENCEDORES DAS QUARTAS DE FINAL - SORTEIO
            var winnersQuarters       = classifiedSelectionsForSemiFinal.Values.ElementAt(0);
            var disqualifiedsQuarters = classifiedSelectionsForSemiFinal.Values.ElementAt(1);

            //#################################################### SEMI-FINAL #################################################

            ViewBag.classifiedSelectionsForSemiFinals = classifiedSelectionsForSemiFinal;
            var selectionsRafflesSemiFinals = _rafflesAppService.RafflesSemiFinal(winnersQuarters);

            ViewBag.selectionsRafflesSemiFinals = selectionsRafflesSemiFinals;

            // VENCEDORES DAS SEMI-FINAIS
            var classifiedSelectionsForFinal = _matchAppService.PlaySemiFinal(selectionsRafflesSemiFinals);

            // VENCEDORES DAS SEMI DE FINAIS
            var winnersSemiFinal       = classifiedSelectionsForFinal.Values.ElementAt(0);
            var disqualifiedsSemiFinal = classifiedSelectionsForFinal.Values.ElementAt(1);

            //###################################################### FINAL ####################################################

            ViewBag.classifiedSelectionsForFinal = classifiedSelectionsForFinal;
            var selectionChampion = _matchAppService.PlayFinal(winnersSemiFinal);

            return(View());
        }