// Кнопка "Добавить новый документ" private void AddButton_Click(object sender, System.Windows.RoutedEventArgs e) { var window = new AddNewDocument(); window.ShowDialog(); if (window.DialogResult == true) { RefreshTable(); } }
// Кнопка "Редактировать документ" private void EditButton_Click(object sender, System.Windows.RoutedEventArgs e) { int currentId = (DocumentsList.SelectedItem as BookClasses.HrDocument).Id; var window = new AddNewDocument(currentId); window.ShowDialog(); if (window.DialogResult == true) { RefreshTable(); } }
public void AddItem() { AddNewDocument and = new AddNewDocument(); and.Owner = MainService.MainWindow; var result = and.ShowDialog(); if (result.Value) { SqlServices.AddEmptyDocument(and.IdType); documentsContainer.ClearAllDocuments(); LoadDocuments(); } }