Пример #1
0
        //Skapar en ny podcast
        private void Ny_Podcast_Click(object sender, EventArgs e)
        {
            try
            {
                if (podcastValidation.isInputEmpty(textBox_Namn.Text) == false)
                {
                    if (podcastValidation.isNotValidURL(textBox_URL.Text) == false)
                    {
                        if (podcastValidation.isUppdateringsFrekvensEmpty(comboBox_UF) == false)
                        {
                            if (podcastValidation.isKategoriEmpty(comboBox_Kategori) == false)
                            {
                                int updateFrequency = int.Parse(comboBox_UF.SelectedItem.ToString());
                                podcastController.CreatePodcast(textBox_URL.Text, comboBox_Kategori.SelectedItem.ToString(), updateFrequency, GetNumberOfEpisodes(textBox_URL.Text), textBox_Namn.Text);
                                ClearNewPodcastFields();
                                ShowPodcasts();

                                Spara_Podcast.Enabled = false;
                                button_Visa.Enabled   = false;
                                textBox_URL.Enabled   = true;
                            }
                        }
                    }
                }
            }
            catch (OurExceptions ex)
            {
                MessageBox.Show(ex.Message);
            }
        }