private void Button_Click_DeleteCustomer(object sender, RoutedEventArgs e) { Resources.Notifications.Confirmations confirmation = new Resources.Notifications.Confirmations(); confirmation.Output.Text = "Vil du slette denne kunde?"; confirmation.ShowDialog(); if (confirmation.confirmed) { customerFindViewModel.DeleteCustomer(); ((Window)this.Parent).Close(); } }
public void Button_Click_RemoveContact(object sender, RoutedEventArgs e) { Resources.Notifications.Confirmations confirmation = new Resources.Notifications.Confirmations(); confirmation.Output.Text = "Vil du slette denne kontaktperson?"; confirmation.ShowDialog(); if (confirmation.confirmed) { Button contact = ((Button)sender); if (contact.DataContext is Contact deleteme) { customerFindViewModel.RemoveContact(deleteme); } } }
public void Button_Click_RemoveDepartment(object sender, RoutedEventArgs e) { Resources.Notifications.Confirmations confirmation = new Resources.Notifications.Confirmations(); confirmation.Output.Text = "Vil du slette denne afdeling?"; confirmation.ShowDialog(); if (confirmation.confirmed) { Button department = ((Button)sender); if (department.DataContext is Department deleteme) { customerFindViewModel.DeleteDepartment(deleteme); } } }