private void Exit(object sender, RoutedEventArgs routedEventArgs)
        {
            ModifyAccount modifyAccount = new ModifyAccount();

            modifyAccount.InitializeDataPlayer();
            modifyAccount.Show();
            this.Close();
        }
Example #2
0
 private void UpdateAccount(object sender, RoutedEventArgs e)
 {
     try
     {
         ModifyAccount modifyAccount = new ModifyAccount();
         modifyAccount.EmailReceived(emailAccount);
         modifyAccount.ObtainAccount();
         modifyAccount.Show();
         this.Close();
     } catch (EndpointNotFoundException exception)
     {
         TelegramBot.SendToTelegram(exception);
         LogException.Log(this, exception);
         LogException.ErrorConnectionService();
     }
 }
Example #3
0
 private void ChangeAccountPassword(object sender, RoutedEventArgs routedEventArgs)
 {
     imgErrorConfirmationPassword.Visibility = Visibility.Hidden;
     imgErrorCurrentPassword.Visibility      = Visibility.Hidden;
     imgErrorNewPassword.Visibility          = Visibility.Hidden;
     pbConfirmationPassword.BorderBrush      = Brushes.Transparent;
     pbPassword.BorderBrush    = Brushes.Transparent;
     pbNewPassword.BorderBrush = Brushes.Transparent;
     isValidNewPassword        = false;
     ValidatePassword();
     ValidateNewPassword();
     if (isValidPassword && isValidNewPassword)
     {
         string passwordEncrypt = Security.Encrypt(pbNewPassword.Password);
         try
         {
             InstanceContext     instanceContext = new InstanceContext(this);
             PlayerManagerClient playerManager   = new PlayerManagerClient(instanceContext);
             playerManager.ChangePassword(account.Email, passwordEncrypt);
             if (responseBoolean)
             {
                 OpenMessageBox(Properties.Resources.ChangePasswordMessage, Properties.Resources.ChangePasswordMessageTitle, (MessageBoxImage)System.Windows.Forms.MessageBoxIcon.Information);
             }
             else
             {
                 OpenMessageBox(Properties.Resources.NoChangePasswordMessage, Properties.Resources.ChangePasswordMessageTitle, (MessageBoxImage)System.Windows.Forms.MessageBoxIcon.Error);
             }
             ModifyAccount modifyAccount = new ModifyAccount();
             modifyAccount.ObtainAccount();
             modifyAccount.Show();
             this.Close();
         } catch (EndpointNotFoundException exception)
         {
             TelegramBot.SendToTelegram(exception);
             LogException.Log(this, exception);
             LogException.ErrorConnectionService();
         }
     }
     else
     {
         OpenMessageBox(Properties.Resources.IncorrectDataMessage, Properties.Resources.IncorrectDataMessageTitle, (MessageBoxImage)System.Windows.Forms.MessageBoxIcon.Warning);
     }
 }