Esempio n. 1
0
        private void SubmitButton_Click(object sender, EventArgs e)
        {
            WeatherData displayWD = new WeatherData();

            displayWD.SetZip(this.userZipBox = zipBox.Text);
            ObtainUserInformation oui = new ObtainUserInformation((displayWD.GetZip()), (displayWD.GetDate()), sender);

            displayWD.SetDate(oui.DateFormatter(this.userDateBox = dateBox.Text));
            if (oui.ValidateZipInput(displayWD.GetZip()) == false)
            {
                displayBox.AppendText("Sorry, that is an invalid zip code.");
            }
            else
            {
                string[] rawAirportData = oui.DivideAirportsByNewLine(oui.ObtainRawAirportData());
                displayWD.SetIcao(oui.ParseForK(oui.ObtainICAOCode(rawAirportData)));
                ObtainWeatherData owd = new ObtainWeatherData(displayWD, sender);
                // displayBox.AppendText("Width: " + displayWD.GetWeatherDataWidth() + "\tLength: " + displayWD.GetWeatherDataLength());
                for (int i = 0; i < displayWD.GetWeatherDataLength(); i++)
                {
                    displayBox.AppendText(owd.GetWeatherRow(displayWD, i));
                }
            }
            //displayBox.AppendText(owd.GetAllWeatherData(dd.SendWeatherData(), sender));
        }
Esempio n. 2
0
 private string getWeatherURL(WeatherData wd)
 {
     return(@"http://api.wunderground.com/history/airport/" + wd.GetIcao() + "/" + wd.GetDate() + "/DailyHistory.html?reqdb.zip=" + wd.GetZip());
 }