Пример #1
0
        // This method displays the captured information that has been set by the forcaster
        private void btnView_Click(object sender, EventArgs e)
        {
            this.Hide();
            WeatherReport form = new WeatherReport();

            form.ShowDialog();
        }
Пример #2
0
        // This Method takes the user back to the weather report form
        private void btnBack_Click(object sender, EventArgs e)
        {
            this.Hide();
            WeatherReport form = new WeatherReport();

            form.disableButton();
            form.ShowDialog();
        }
Пример #3
0
 // A Method that validates the user's credentials and logs in a user
 public void login()
 {
     if (txtUsername.Text.Equals("") || txtPassword.Text.Equals(""))
     {
         MessageBox.Show("Please populate the empty fields");
     }
     else
     {
         for (int i = 0; i < WeatherWorker.login.Count; i++)
         {
             if (WeatherWorker.login[i].Username == txtUsername.Text && WeatherWorker.login[i].Password == EncodePasswordToBase64(txtPassword.Text))
             {
                 if (WeatherWorker.login[i].UserType.Equals("Admin"))
                 {
                     WeatherCapture form = new WeatherCapture();
                     txtUsername.Text = "";
                     txtPassword.Text = "";
                     this.Hide();
                     form.ShowDialog();
                     this.Show();
                 }
                 else if (WeatherWorker.login[i].UserType.Equals("General User"))
                 {
                     WeatherReport form = new WeatherReport();
                     txtUsername.Text = "";
                     txtPassword.Text = "";
                     this.Hide();
                     form.disableButton();
                     form.ShowDialog();
                     this.Show();
                 }
             }
         }
         MessageBox.Show("Please Enter a Valid Username and Password");
     }
 }