private void ImportStart() { int catalogID = -1; labelSuccess.Content = "0"; labelFailed.Content = "0"; if (datagridFilelist.Items.Count == 0) { return; } if ((bool)labelGenre.Tag == false) { var result = MessageBox.Show($"Missing genre '{comboboxGenre.Text}' in table tGenre!\n\n" + "You want create this genre?", "New Genre", MessageBoxButton.YesNo, MessageBoxImage.Exclamation); if (result == MessageBoxResult.No) { return; } else { catalogID = DataGetSet.CreateGenre(comboboxGenre.Text); } } if ((bool)labelCatalog.Tag == false) { var result = MessageBox.Show($"Missing catalog '{comboboxCatalog.Text}' in table tCatalogs!\n\n" + "You want create this catalog?", "New Catalog", MessageBoxButton.YesNo, MessageBoxImage.Exclamation); if (result == MessageBoxResult.No) { return; } catalogID = DataGetSet.CreateCatalog(comboboxCatalog.Text); if (catalogID == -1) { return; } } Import((bool)checkboxSampler.IsChecked); }