Esempio n. 1
0
        private void btnDeleteCategory_Click(object sender, EventArgs e)
        {
            if (Validator.CheckIfCategoryItemSelected(lbxCategories))
            {
                string categoryName = lbxCategories.SelectedItem?.ToString();

                DialogResult res = MessageBox.Show("Are you sure you want to delete the category " + categoryName + "?", "Confirmation", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
                if (res == DialogResult.OK)
                {
                    categoryController.DeleteCategory(categoryName);
                    podcastController.DeletePodcastByCategory(categoryName);
                    FillPodcastList();
                    FillCategoryList();
                    FillCategoryComboBox();
                    txtCategory.Text = string.Empty;
                    ClearEpisodesList();
                    ClearInputs();
                }
            }
        }