private void EditButton_Click(object sender, RoutedEventArgs e) { if (MainDatagrid.SelectedItem == null) { MessageBox.Show("Необходимо выбрать нужного пользователя"); return; } Windows.AddOrEditEmployee window = new AddOrEditEmployee(MainDatagrid.SelectedItem as Worker); window.Show(); this.Close(); }
private void AddButton_Click(object sender, RoutedEventArgs e) { Windows.AddOrEditEmployee window = new AddOrEditEmployee(new Worker()); window.Show(); this.Close(); }