Пример #1
0
 //Displays the podcasts based on what category is selected
 private void BtnSortPodByCat_Click(object sender, EventArgs e)
 {
     if (validator.CategorySelected(LstCat))
     {
         string category = LstCat.SelectedItem.ToString();
         var    podList  = podcastController.RetrieveAllPodcasts();
         ClearAndSet();
         if (PodcastFeed.Rows.Count > 0)
         {
             foreach (var pod in podList)
             {
                 if (pod.Category != category)
                 {
                     string name  = pod.Name;
                     int    index = podRepo.GetIndex(name);
                     PodcastFeed.Rows[index].Visible = false;
                 }
                 else
                 {
                     string name  = pod.Name;
                     int    index = podRepo.GetIndex(name);
                     PodcastFeed.Rows[index].Visible = true;
                 }
             }
         }
     }
 }