Beispiel #1
0
        public PCOUsage(Campus location, DateTime itemDate, PCOItem songItem, int songSlot)
        {
            this.Location = location;
            this.dates    = new List <DateTime>();
            intializeSlots();
            this.dates.Add(itemDate);
            if (this.slots.ContainsKey(songSlot))
            {
                this.slots[songSlot] += 1;
            }
            else
            {
                this.slots.Add(songSlot, 1);
            }

            this.title      = songItem.SongTitle;
            this.artist     = songItem.SongAuthor;
            this.songID     = songItem.SongID;
            this.ccliNumber = songItem.CCLINumber;
        }
Beispiel #2
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);
                     }
                 }
             }
         }
     }
 }