/// <summary> /// Событие, вызываемое при нажатии на кнопку "GetWordListButton". Выводит данные об активных аккаунтах в документ Word. /// </summary> /// <param name="sender">Объект, вызвавший событие.</param> /// <param name="e">Аргументы события.</param> private void GetWordListButton_Click(object sender, RoutedEventArgs e) { if (UserProfile.CheckActiveAccounts()) { StandartDialog wordDialog = new StandartDialog(DialogVariant.FileCreation); wordDialog.ShowDialog(); if (!wordDialog.Error) { Bool question = MessageBox.Show("Открыть документ после его создания?", "Подтверждение", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes; UserProfile.CreateWordUserList(wordDialog.FirstBoxText, wordDialog.SecondBoxText, question); } wordDialog.Dispose(); } }
/// <summary> /// Событие, вызываемое при нажатии на кнопку "DeleteAccountButton". Удаляет указанный аккаунт, если будет пройдена проверка безопасности. /// </summary> /// <param name="sender">Объект, вызвавший событие.</param> /// <param name="e">Аргументы события.</param> private void DeleteAccountButton_Click(object sender, RoutedEventArgs e) { if (UserProfile.CheckActiveAccounts()) { StandartDialog deleteDialog = new StandartDialog(DialogVariant.AccountDeleting); deleteDialog.ShowDialog(); UserProfile profileToDelete = UserProfile.CheckAccount(deleteDialog.FirstBoxText, deleteDialog.SecondBoxText); if (!deleteDialog.Error) { if (MessageBox.Show("Вы ТОЧНО уверены?\nАккаунт будет удален безвозвратно!", "Внимание!", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.Yes) { profileToDelete.DeleteUser(); } } deleteDialog.Dispose(); } }