// //Capture section Code // private void SubmitButton_Click(object sender, EventArgs e) { CheckValues(); if (valuesGood == true && cityBox.Text != "") { //Add values to relevant arrays if data is input correctly if (cityBox.Items.Contains(cityBox.Text)) { Weather.AddCityName(cityBox.Items[cityBox.Items.IndexOf(cityBox.Text)]); } else { Weather.AddCityName(cityBox.Text); } Weather.AddWeatherDate(dateInputBox.Value); Weather.AddMinTemp(minTempBox.Text); Weather.AddMaxTemp(maxTempBox.Text); Weather.AddPrecipitation(precipBox.Text); Weather.AddHumidity(humidBox.Text); Weather.AddWindSpeed(windBox.Text); Weather.AddWeatherDatabase(); MessageBox.Show("Data Captured Successfully."); } else { MessageBox.Show("The data you have entered is incorrect. \nPlease make sure that: \n- No fields are empty.\n- There are no numbers in the city input field.\n- There are no letters in the in the number fields."); } }
private void UsersStrip_Click(object sender, EventArgs e) { Weather.AddWeatherDatabase(); this.Hide(); Users newUsers = new Users(); newUsers.ShowDialog(); this.Close(); }
private void UpdateStrip_Click(object sender, EventArgs e) { Weather.AddWeatherDatabase(); this.Hide(); Update newUpdate = new Update(); newUpdate.ShowDialog(); this.Close(); }
private void ReportStrip_Click(object sender, EventArgs e) { Weather.AddWeatherDatabase(); this.Hide(); Report reportForm = new Report(); reportForm.ShowDialog(); this.Close(); }
private void LogoutToolStripMenuItem_Click(object sender, EventArgs e) { Weather.AddWeatherDatabase(); Report.firstTimeLoad = true; this.Hide(); Login newLogin = new Login(); newLogin.ShowDialog(); this.Close(); }
// //End of preventing intial incorrect input // // //Menu Strip Items // private void ExitToolStripMenuItem_Click(object sender, EventArgs e) { Weather.AddWeatherDatabase(); this.Close(); }
private static void OnProcessExit(object sender, EventArgs e) { Weather.AddWeatherDatabase(); }