示例#1
0
 public void GetSongs()
 {
     this.Songs = new List <PCOItem>();
     if (this.URL != String.Empty)
     {
         if (_serviceData == null)
         {
             _serviceData = Utility.GetRequestObject(this.URL);
         }
         this.ItemsURL = (_serviceData.data.links.items != null) ? _serviceData.data.links.items.ToString() : String.Empty;
         if (this.ItemsURL != String.Empty)
         {
             dynamic itemsData = Utility.GetRequestObject(this.ItemsURL);
             if (itemsData.data != null)
             {
                 int order = 0;
                 foreach (dynamic itemDynamic in itemsData.data)
                 {
                     if (itemDynamic.attributes.item_type == "song")
                     {
                         order += 1;
                         PCOItem song = new PCOItem(this, itemDynamic);
                         if (this.WorshipLeader != null)
                         {
                             Location.GetLeader(this.WorshipLeader.ID); //Need to update the list
                             song.LeaderID = this.WorshipLeader.ID;
                         }
                         else
                         {
                             string x = "1";
                             x += "X";
                         }
                         song.Order = order;
                         this.Songs.Add(song);
                     }
                 }
             }
         }
     }
 }