private void ExecuteChangePasswordCommand(object obj)
        {
            var oldPw  = _view.PasswordBox1.Password;
            var newPw1 = _view.PasswordBox2.Password;
            var newPw2 = _view.PasswordBox3.Password;

            if (newPw1 != newPw2)
            {
                MessageBox.Show("Neue Passwörter stimmen nicht überein!");
                return;
            }

            var success = _client.ChangePassword(ApplicationData.User, oldPw, newPw2);

            if (!success)
            {
                MessageBox.Show("Altes Passwort war falsch!");
                return;
            }
            MessageBox.Show("Passwort erfolgreich geändert!");
            _view.Close();
        }
Esempio n. 2
0
 internal bool ChangePassword(string username, string oldPassword, string newPassword)
 {
     return(client.ChangePassword(username, oldPassword, newPassword));
 }