Ejemplo n.º 1
0
        private void startHTTPWorker(string input) // this is the function which is started by the new thread
        {
            HTTPIO gwc = new HTTPIO(); // creates object of class HTTPIO which handles all internet operations
            changeWeatherIcon((gwc.getWeatherJSON(input)), input); // starts the function selectWeatherIcon with the returned data of of the HTTPIO class

        }
Ejemplo n.º 2
0
        private void getPrice(string inputAirport, string destAirport)// this is the method started by the new thread
        {
            HTTPIO httpIO = new HTTPIO();  //declares object of class HTTPIO, which is used for internet operations

            distance = httpIO.getDistance(inputAirport, destAirport); // uses class get distance to work out price from the distance
            distance = distance * 0.001; // makes the number more sensible for price calculation
            
            if (distance == 0) // if the distance was zero, something went wrong
            {

                MessageBox.Show("Something went wrong");

            }
            else if (distance > 0 && distance < 99) // calculations to make a sensible price
            {
                MessageBox.Show("between 0 and 99");
                price = distance / 2;


            }
            else if (distance > 100 && distance < 500)
            {

                MessageBox.Show("Between 100 and 500");
                price = distance / 10;

            }
            else if (distance > 500 && distance < 750)
            {

                MessageBox.Show("between 500 & 750");
                price = distance / 10;

            }
            else if (distance > 750 && distance < 1250)
            {

                MessageBox.Show("between 750 & 1250");
                price = distance / 5;
            }
            else if (distance > 1250)
            {
                price = distance / 5;


            }
            

           
            isFinnished = true;

        }