Exemple #1
0
    protected void ImageButton2_Click(object sender, ImageClickEventArgs e)
    {
        string str = "";

        str = client.GetHelpAsync(2).Result;
        string js = "<script> confirm('" + str + "')</script>";

        Page.RegisterStartupScript("", js);
    }
Exemple #2
0
        private void ConfirmButtonClick(object sender, EventArgs args)
        {
            if (searchCity.Checked == true)
            {
                CreateSearchCityPanel();
            }

            if (searchStation.Checked == true)
            {
                CreateSearchStationPanel();
            }
            if (getHelp.Checked == true)
            {
                client.GetHelpAsync();
            }
        }
Exemple #3
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.");
                }
            }
        }
Exemple #4
0
 private static void GetHelp()
 {
     Console.WriteLine(client.GetHelpAsync(0).Result);
 }