private void Modify_Click(object sender, RoutedEventArgs e) { try { Dog dog = (Dog)this.DogsGrid.SelectedItem; if (dog != null) { Window modifyDog = new AddSpecimenWindow(dog.DogId); modifyDog.Left = this.Left; modifyDog.Top = this.Top; modifyDog.Show(); this.Close(); } else { System.Windows.MessageBox.Show("Nie wybrano psa.", "Błąd", System.Windows.MessageBoxButton.OK); } } catch (Exception x) { ShowError(x.Message); } }
private void AddSpecimen_Click(object sender, RoutedEventArgs e) { Window addSpecimenWindow = new AddSpecimenWindow(); addSpecimenWindow.Left = this.Left; addSpecimenWindow.Top = this.Top; addSpecimenWindow.Show(); this.Close(); }