Exemple #1
0
 private void ConfirmCityButtonClick(object sender, EventArgs args)
 {
     if (cityTextBox.Text != "")
     {
         client.GetStationsOfACityAsync(cityTextBox.Text);
     }
     else
     {
         MessageBox.Show("Please input a city");
     }
 }
Exemple #2
0
        static void Main(string[] args)
        {
            VelibServiceClient client = new VelibServiceClient("service1");

            init(client);
            Console.WriteLine("Welcome to velib.");
            while (true)
            {
                Console.WriteLine("\nWhat do you want to do:\n1. List all stations of a city;\n" +
                                  "2. Search for a station by name;\n3. Help;\n4. Quit");
                string choice = Console.ReadLine();
                if (choice == "1")
                {
                    Console.WriteLine("Please input a city:");
                    client.GetStationsOfACityAsync(Console.ReadLine());
                    Console.ReadLine();
                }
                else if (choice == "2")
                {
                    Console.WriteLine("Please input a city:");
                    string city = Console.ReadLine();
                    Console.WriteLine("Please input a station:");
                    string station = Console.ReadLine();
                    client.GetStationInfoAsync(city, station);
                    Console.ReadLine();
                }
                else if (choice == "3")
                {
                    client.GetHelpAsync();
                    Console.ReadLine();
                }
                else if (choice == "4")
                {
                    Console.WriteLine("See you later");
                    break;
                }
                else
                {
                    Console.WriteLine("Please choose from 1 to 4.");
                }
            }
        }