private void AddAnnotator_Click(object sender, RoutedEventArgs e) { List <string> users = DatabaseHandler.GetUsers(); if (users.Count > 0) { DatabaseAnnotator annotator = new DatabaseAnnotator(); List <string> names = DatabaseHandler.GetUsers(); foreach (string name in AnnotatorsBox.Items) { names.RemoveAll(s => s == name); } DatabaseAdminAnnotatorWindow dialog = new DatabaseAdminAnnotatorWindow(ref annotator, names); dialog.WindowStartupLocation = WindowStartupLocation.CenterScreen; dialog.ShowDialog(); if (dialog.DialogResult == true) { if (DatabaseHandler.AddOrUpdateAnnotator(annotator)) { GetAnnotators(annotator.Name); } } } }
private void EditAnnotator_Click(object sender, RoutedEventArgs e) { if (AnnotatorsBox.SelectedItem != null) { string user = (string)AnnotatorsBox.SelectedItem; DatabaseAnnotator annotator = new DatabaseAnnotator { Name = user }; if (DatabaseHandler.GetAnnotator(ref annotator)) { DatabaseAdminAnnotatorWindow dialog = new DatabaseAdminAnnotatorWindow(ref annotator); dialog.WindowStartupLocation = WindowStartupLocation.CenterScreen; dialog.ShowDialog(); if (dialog.DialogResult == true) { DatabaseHandler.AddOrUpdateAnnotator(annotator); GetAnnotators(); } } } }