Exemplo n.º 1
0
        public List <Train> AllStationsData()
        {
            StationsList stationList = new StationsList();       //get lists of stations & directions id's

            List <Train> listTrain        = new List <Train>();  //output
            List <Train> initialListTrain = new List <Train>();  //current output from Scraper(...)

            List <Station> listStation   = new List <Station>(); //list with starting station id's
            List <Station> listDirection = new List <Station>(); //list with ending station id's


            bool flag;

            listStation   = stationList.GetStations();
            listDirection = stationList.GetDirections();

            for (int i = 0; i < listStation.Count; i++)
            {
                for (int j = 0; j < listDirection.Count; j++)
                {
                    for (int k = 0; k < 2; k++)
                    {
                        flag = (k == 0) ? true : false;

                        if (i != j)
                        {
                            initialListTrain.Clear();
                            initialListTrain = Scraper(listStation[i].Id, listDirection[j].Id, flag);
                            listTrain.AddRange(initialListTrain);
                        }
                    }
                }
            }

            return(listTrain);
        }