Beispiel #1
0
 public void SuccessfullPasswordChange()
 {
     NavigateTo();
     OldPassword.Clear();
     OldPassword.SendKeys("1234");
     NewPassword.Clear();
     NewPassword.SendKeys("123456");
     ConfirmPassword.Clear();
     ConfirmPassword.SendKeys("123456");
     ChangePasswordButton.Click();
 }
Beispiel #2
0
 public void EnterMissmatchingNewPassword()
 {
     NavigateTo();
     OldPassword.Clear();
     OldPassword.SendKeys("1234");
     NewPassword.Clear();
     NewPassword.SendKeys("123456");
     ConfirmPassword.Clear();
     ConfirmPassword.SendKeys("12345");
     ChangePasswordButton.Click();
 }
Beispiel #3
0
 public void EnterIncorrectCurrentPasswordChange()
 {
     NavigateTo();
     OldPassword.Clear();
     OldPassword.SendKeys("12345");
     NewPassword.Clear();
     NewPassword.SendKeys("123456");
     ConfirmPassword.Clear();
     ConfirmPassword.SendKeys("123456");
     ChangePasswordButton.Click();
 }
Beispiel #4
0
 private void PasswordChange_Click_1(object sender, RoutedEventArgs e)
 {
     if (OldPassword.Password != Oldpassword)
     {
         MessageBox.Show("Incorrect Old Password. Please try again",
                         "Password Info", MessageBoxButton.OK, MessageBoxImage.Information);
         OldPassword.Clear();
         NewPassword.Clear();
         OldPassword.Focus();
         return;
     }
     if (PasswordChangeEvent != null)
     {
         PasswordChangeEvent(this, new PasswordChangeEventArgs(NewPassword.Password));
     }
 }
Beispiel #5
0
 private void PasswordChange_Click_1(object sender, RoutedEventArgs e)
 {
     if (OldPassword.Password != ((User)UserSelector.SelectedItem).Password)
     {
         MessageBox.Show("Incorrect Old Password. Please try again",
                         "Password Info", MessageBoxButton.OK, MessageBoxImage.Information);
         OldPassword.Clear();
         NewPassword.Clear();
         OldPassword.Focus();
         return;
     }
     if (PasswordChangeEvent != null)
     {
         User u = ((User)UserSelector.SelectedItem);
         PasswordChangeEvent(this, new PasswordChangeEventArgs(new User(u.Name, NewPassword.Password)));
     }
 }
        private void resetButtonClick(object sender, RoutedEventArgs e)
        {
            try
            {
                if (checkBox.IsChecked == true)
                {
                    if (!string.IsNullOrWhiteSpace(resetUsername.Text) && !string.IsNullOrWhiteSpace(OldPassword.Password))
                    {
                        string oldPassword = OldPassword.Password.ToString();
                        string userToReset = resetUsername.Text.ToString();
                        string newPassword = NewPassword.Password.ToString();

                        SqlConnection Aconn = new SqlConnection();
                        Aconn.ConnectionString = ConfigurationManager.ConnectionStrings["Other"].ConnectionString;

                        string Newquery = "UPDATE UserTable SET [password]=@newPass WHERE [username]=@user AND [password]=@pass;";

                        SqlCommand cmd = new SqlCommand(Newquery, Aconn);
                        cmd.Parameters.AddWithValue("@newPass", newPassword);
                        cmd.Parameters.AddWithValue("@user", userToReset);
                        cmd.Parameters.AddWithValue("@pass", oldPassword);
                        Aconn.Open();
                        cmd.ExecuteNonQuery();
                        Aconn.Close();

                        OldPassword.Clear();
                        resetUsername.Clear();
                        NewPassword.Clear();
                        MessageBox.Show("Password Change successful");
                    }
                }
            }
            catch (Exception err)
            {
                MessageBox.Show(err.ToString());
            }
        }
Beispiel #7
0
 private void Clear()
 {
     OldPassword.Clear();
     NewPassword.Clear();
     RepeatPassword.Clear();
 }