예제 #1
0
        public List <Ligas> AddTeams() //BASE DE DATOS DE LIGAS
        {
            Ligas AFA     = new Ligas();
            Ligas BBVA    = new Ligas();
            Ligas PREMIER = new Ligas();

            AFA.Nombre        = "AFA - Superliga argentina";
            AFA.TeamsQuantity = new DataTeamsAFA().FetchTeams().Count;
            AFA.FetchTeams    = new DataTeamsAFA().FetchTeams();

            BBVA.Nombre        = "BBVA - Liga española";
            BBVA.TeamsQuantity = new DataTeamsBBVA().FetchTeams().Count;
            BBVA.FetchTeams    = new DataTeamsBBVA().FetchTeams();


            PREMIER.Nombre        = "Premier League - Liga inglesa";
            PREMIER.TeamsQuantity = new DataTeamsPREMIER().FetchTeams().Count;
            PREMIER.FetchTeams    = new DataTeamsPREMIER().FetchTeams();

            List <Ligas> ligas = new List <Ligas>
            {
                AFA,
                BBVA,
                PREMIER,
            };

            return(ligas);
        }
예제 #2
0
        public Ligas DataLeagueVerification(List <Ligas> league, Ligas leagues, List <Equipos> team)
        {
            int  userDecision = 0;
            bool status       = false;

            while (!status)
            {
                Console.WriteLine("Elija Liga ingresando valor y confirme presionando Enter");
                status = int.TryParse(Console.ReadLine(), out userDecision);
                if (status)
                {
                    if (userDecision > league.Count || userDecision < 0)
                    {
                        Console.WriteLine("Dato ingresado no valido");
                        userDecision = 0;
                        status       = false;
                    }
                    else
                    {
                        leagues = league[userDecision - 1];
                    }
                }
                else
                {
                    Console.WriteLine("Dato ingresado no valido");
                    userDecision = 0;
                }
            }
            return(leagues);
        }