private void BackBTN_Click(object sender, RoutedEventArgs e) { StudentControls stud = new StudentControls(); stud.Show(); this.Close(); }
private void loginButton_Click(object sender, RoutedEventArgs e) { if (string.IsNullOrEmpty(idTextBox.Text) || string.IsNullOrEmpty(Password_txt.Password)) { MessageBox.Show("Please enter a valid username and password."); } else { if (WelcomePage.AllStudentsDictionary.ContainsKey(idTextBox.Text)) { if (WelcomePage.AllStudentsDictionary[idTextBox.Text].Password == Password_txt.Password) { MessageBox.Show("Logging in.."); WelcomePage.StudentLogedIn = true; WelcomePage.StudentId = idTextBox.Text; WelcomePage.StudentPassword = Password_txt.Password; StudentControls StudControls = new StudentControls(); StudControls.Show(); this.Close(); } else { MessageBox.Show("Wrong password."); } } else { MessageBox.Show("User does not exist."); } } }