/// <summary> /// Home button /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Home_Click(object sender, RoutedEventArgs e) { Real_main_window r1 = new Real_main_window(); this.Close(); r1.Show(); }
/// <summary> /// if the conditions are met the MainWindow will appear; otherwise there will be 2 more chances to connect /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Button_Click(object sender, RoutedEventArgs e) { String newPass = ComputeSha256Hash(password.Password); //convert the pass to hash256 if (Verify(_user, newPass)) { InsertAudit(); this.Close(); var r1 = new Real_main_window(_user); r1.Show(); } else { _attempts++; MessageBox.Show("Try again!" + "\n" + "You have tried " + _attempts + " out of 3"); } if (_attempts == 3) { MessageBox.Show("Bye"); Application.Current.Shutdown(); } }