private void HandleLoginCommand(object parameter) { var passwordBox = parameter as PasswordBox; var password = passwordBox.Password; var authenticationCode = this.GetSHA1HashData(password); var username = DataPersister.LoginUser(this.Username, authenticationCode); if (!string.IsNullOrEmpty(username)) { this.RaiseLoginSuccess(username); } }
private void HandleLoginCommand(object parameter) { var passwordBox = parameter as PasswordBox; var password = passwordBox.Password; var authenticationCode = this.GetSHA1HashData(password); try { var username = DataPersister.LoginUser(this.Username, authenticationCode); if (!string.IsNullOrEmpty(username)) { this.RaiseLoginSuccess(username); } } catch (ArgumentException argEx) { this.Message = argEx.Message; } catch (Exception ex) { this.Message = ex.Message; } }