Example #1
0
        // find station by its id
        public Stations findStation(int stationID)
        {
            var query = from station in m_CTA.Stations

                        where station.StationID == stationID
                        select station;

            // if we did retrieve data
            if (query != null)
            {
                //format the data that was retrieved and add it to myStation
                foreach (var row in query)
                {
                    Stations myStation = new Stations(Convert.ToInt32(row.StationID), Convert.ToString(row.Name));
                    return myStation;
                }
            }

            return null;
        }
Example #2
0
        // find station by its id
        public Stations findStation(int stationID)
        {
            var query = from station in m_CTA.Stations

                        where station.StationID == stationID
                        select station;

            // if we did retrieve data
            if (query != null)
            {
                //format the data that was retrieved and add it to myStation
                foreach (var row in query)
                {
                    Stations myStation = new Stations(Convert.ToInt32(row.StationID), Convert.ToString(row.Name));
                    return(myStation);
                }
            }

            return(null);
        }
Example #3
0
        // get the stations info
        public IReadOnlyList <Stations> getStations()
        {
            List <Stations> stations = new List <Stations>();

            var query = from stats in m_CTA.Stations
                        select stats;

            // if we did retrieve data
            if (query != null)
            {
                //format the data that was retrieved and add it to the list stations
                foreach (var row in query)
                {
                    Stations newAdd = new Stations(Convert.ToInt32(row.StationID), Convert.ToString(row.Name));
                    stations.Add(newAdd);
                }

                return(stations);
            }

            return(null);
        }
Example #4
0
        // get the stations info
        public IReadOnlyList<Stations> getStations()
        {
            List<Stations> stations = new List<Stations>();

            var query = from stats in m_CTA.Stations
                    select stats;

            // if we did retrieve data
            if (query != null)
            {
            //format the data that was retrieved and add it to the list stations
            foreach (var row in query)
            {

                Stations newAdd = new Stations(Convert.ToInt32(row.StationID), Convert.ToString(row.Name));
                stations.Add(newAdd);
            }

            return stations;
            }

            return null;
        }