Ejemplo n.º 1
0
        public string FindStationById(int id)
        {
            StationsList stations = new StationsList();
            List<Station> list = new List<Station>();
            list = stations.GetStations();

            return list.FirstOrDefault(x => x.Id == id).Name;
        }
Ejemplo n.º 2
0
        public Form1()
        {
            InitializeComponent();
            lblXml.Text = string.Empty;
            lblXsd.Text = string.Empty;

            StationsList station = new StationsList();

            PrepareCombo(station.GetStations(), stationFrom);
            PrepareCombo(station.GetDirections(), stationTo);

            fromHour.Items.Clear();
            int[] tabWithHours = GetHoursList();

            for (int i = 0; i < 24; i++)
                fromHour.Items.Add(tabWithHours[i]);
        }
Ejemplo n.º 3
0
        private int FindStationByName(string name)
        {
            StationsList stations = new StationsList();
            List<Station> list = new List<Station>();
            list = stations.GetStations();
            int ret;

            try
            {
                ret = list.FirstOrDefault(x => x.Name == name).Id;

            }
            catch (System.NullReferenceException e)
            {
                ret = -1;
            }

            return ret;
        }