Пример #1
0
        public static string ToCode(this LineCodeType lineCode)
        {
            switch (lineCode)
            {
            case LineCodeType.Red: return("RD");

            case LineCodeType.Blue: return("BL");

            case LineCodeType.Yellow: return("YL");

            case LineCodeType.Orange: return("OR");

            case LineCodeType.Green: return("GR");
            }
            return(String.Empty);
        }
Пример #2
0
        public Task <StationsContainer> GetStationsByLine(LineCodeType lineCode)
        {
            string url;

            // get stations for a specific line
            if (lineCode != LineCodeType.All)
            {
                string lineCodeString = "?LineCode=" + lineCode.ToCode();
                url = "Rail.svc/Stations" + lineCodeString;
            }

            // list all stations
            else
            {
                url = "Rail.svc/Stations";
            }

            return(Get <StationsContainer>(url));
        }