private void part8_btn_Click(object sender, EventArgs e) { Webweather.ForecastReturn forecasts = new Webweather.ForecastReturn(); Webweather.Weather forecast = new Webweather.Weather(); Webweather.Forecast[] weatherData; TextBox[] description = new TextBox[5]{ Day1_weather, Day2_weather, Day3_weather, Day4_weather, Day5_weather}; //set of 5days weather TextBox[] lowTmps = new TextBox[5]{ Day1_lowTmp, Day2_lowTmp, Day3_lowTmp, Day4_lowTmp, Day5_lowTmp}; TextBox[] highTmps = new TextBox[5]{ Day1_highTmp, Day2_highTmp, Day3_highTmp, Day4_highTmp, Day5_highTmp}; forecasts = forecast.GetCityForecastByZIP(part8_input.Text); //this method will return class as ForecastReturn if (forecasts.ForecastResult != null) //Forecase[] set { weatherData = forecasts.ForecastResult; part8_city.Text = forecasts.City +","+ forecasts.State; //location for (int i = 0; i < 5; i++) { description[i].Text = weatherData[i].Desciption; lowTmps[i].Text = weatherData[i].Temperatures.MorningLow; highTmps[i].Text = weatherData[i].Temperatures.DaytimeHigh; } } else { MessageBox.Show("No weather founded!"); } }
private void part8_btn_Click(object sender, EventArgs e) { Webweather.ForecastReturn forecasts = new Webweather.ForecastReturn(); Webweather.Weather forecast = new Webweather.Weather(); Webweather.Forecast[] weatherData; TextBox[] description = new TextBox[5] { Day1_weather, Day2_weather, Day3_weather, Day4_weather, Day5_weather }; //set of 5days weather TextBox[] lowTmps = new TextBox[5] { Day1_lowTmp, Day2_lowTmp, Day3_lowTmp, Day4_lowTmp, Day5_lowTmp }; TextBox[] highTmps = new TextBox[5] { Day1_highTmp, Day2_highTmp, Day3_highTmp, Day4_highTmp, Day5_highTmp }; forecasts = forecast.GetCityForecastByZIP(part8_input.Text); //this method will return class as ForecastReturn if (forecasts.ForecastResult != null) //Forecase[] set { weatherData = forecasts.ForecastResult; part8_city.Text = forecasts.City + "," + forecasts.State; //location for (int i = 0; i < 5; i++) { description[i].Text = weatherData[i].Desciption; lowTmps[i].Text = weatherData[i].Temperatures.MorningLow; highTmps[i].Text = weatherData[i].Temperatures.DaytimeHigh; } } else { MessageBox.Show("No weather founded!"); } }