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)); }
public void DisplayAllWeatherData(WeatherData wd) { for (int rowValue = 0; rowValue < wd.GetWeatherDataLength(); rowValue++) { DisplayWeatherRow(wd, rowValue); } }
public string GetAllWeatherData(WeatherData wd, object o) { StringBuilder lines = new StringBuilder(); for (int rowValue = 0; rowValue < wd.GetWeatherDataLength(); rowValue++) { lines.Append(GetWeatherRow(wd, rowValue)); lines.Append("\n"); } return(lines.ToString()); }
/* private void InsertHeaderData(ArrayList parsedWeatherData) { * * }*/ private void StoreWeatherData(WeatherData wd, ArrayList parsedWeatherData) { int iterationValue = 0; // Console.WriteLine("Data Length: " + wd.GetWeatherDataLength() + "\tData Width: " + wd.GetWeatherDataWidth()); for (int columnValue = 0; columnValue < wd.GetWeatherDataLength(); columnValue++) { for (int rowValue = 0; rowValue < wd.GetWeatherDataWidth(); rowValue++) { wd.SetWeatherGraphPoint(columnValue, rowValue, parsedWeatherData[iterationValue].ToString()); iterationValue++; } } }