コード例 #1
0
 //
 //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.");
     }
 }
コード例 #2
0
        private void UsersStrip_Click(object sender, EventArgs e)
        {
            Weather.AddWeatherDatabase();
            this.Hide();
            Users newUsers = new Users();

            newUsers.ShowDialog();
            this.Close();
        }
コード例 #3
0
        private void UpdateStrip_Click(object sender, EventArgs e)
        {
            Weather.AddWeatherDatabase();
            this.Hide();
            Update newUpdate = new Update();

            newUpdate.ShowDialog();
            this.Close();
        }
コード例 #4
0
        private void ReportStrip_Click(object sender, EventArgs e)
        {
            Weather.AddWeatherDatabase();
            this.Hide();
            Report reportForm = new Report();

            reportForm.ShowDialog();
            this.Close();
        }
コード例 #5
0
        private void LogoutToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Weather.AddWeatherDatabase();
            Report.firstTimeLoad = true;
            this.Hide();
            Login newLogin = new Login();

            newLogin.ShowDialog();
            this.Close();
        }
コード例 #6
0
        //
        //End of preventing intial incorrect input
        //

        //
        //Menu Strip Items
        //
        private void ExitToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Weather.AddWeatherDatabase();
            this.Close();
        }
コード例 #7
0
 private static void OnProcessExit(object sender, EventArgs e)
 {
     Weather.AddWeatherDatabase();
 }