private void OnModifyLibrarian(object sender, RoutedEventArgs e) { if (LibrariansTable.SelectedItem != null) { AdminUserView selectedLibrarian = LibrariansTable.SelectedItem as AdminUserView; ModifyUserPage modifyLibrarian = new ModifyUserPage(selectedLibrarian.LibrarianID); modifyLibrarian.ShowDialog(); UpdateTable(); } }
private void OnDeleteLibrarian(object sender, RoutedEventArgs e) { if (LibrariansTable.SelectedItem != null) { MessageBoxResult result = MessageBox.Show(SDM.Strings.DELETE_LIBRARIAN_CONFIRMATION_TEXT, SDM.Strings.ATTENTION_TEXT, MessageBoxButton.YesNo); switch (result) { case MessageBoxResult.Yes: AdminUserView selectedLibrarian = LibrariansTable.SelectedItem as AdminUserView; Admin lib = (Admin)SDM.CurrentUser; lib.DeleteLibrarian(selectedLibrarian.LibrarianID); UpdateTable(); break; case MessageBoxResult.No: break; } } }