コード例 #1
0
 private void DeleteAccount(string password)
 {
     if (password.Length != 0)
     {
         if (this.Participant.Password == password)
         {
             MessageBoxResult messageBoxResult = MessageBox.Show("Are you sure?", "Delete confirmation", MessageBoxButton.YesNo);
             if (messageBoxResult == MessageBoxResult.Yes)
             {
                 try
                 {
                     DbAdapter.DeleteAccount(this.Participant.Name);
                     MessageBox.Show($"Account {this.Participant.Name} has been deleted");
                     LogInWindow logInWindow = new LogInWindow();
                     logInWindow.Show();
                     CloseWindows();
                 }
                 catch (Exception exception)
                 {
                     MessageBox.Show(exception.Message);
                 }
             }
         }
         else
         {
             MessageBox.Show("Bad password");
         }
     }
     else
     {
         MessageBox.Show("Password field must be filled");
     }
 }