Ejemplo n.º 1
0
 private void FillComboArtist()
 {
     cbxSongArtist.Items.Add(admin.Todos);
     foreach (Artist artist in admin.Library.artist_list)
     {
         admin.ListItem item = new admin.ListItem();
         item.Text  = artist.name;
         item.Value = artist;
         cbxSongArtist.Items.Add(item);
     }
     cbxSongArtist.SelectedIndex = 0;
 }
Ejemplo n.º 2
0
 private void Refresh_All_Artist_List()
 {
     listAll_Artists.Items.Clear();
     foreach (Artist a in admin.Library.artist_list)
     {
         if (!user.artist_list.Contains(a.id))
         {
             admin.ListItem item = new admin.ListItem();
             item.Text  = a.name;
             item.Value = a;
             listAll_Artists.Items.Add(item);
         }
     }
 }
Ejemplo n.º 3
0
        private void Refresh_User_Artist_List()
        {
            listUser_Artists.Items.Clear();

            foreach (int artist_id in user.artist_list)
            {
                Artist artist = Artist.get(admin.Library.artist_list, artist_id);
                if (artist != null)
                {
                    admin.ListItem item = new admin.ListItem();
                    item.Text  = artist.name;
                    item.Value = artist;
                    listUser_Artists.Items.Add(item);
                }
            }
        }
Ejemplo n.º 4
0
 private void frmAdd_Song_Load(object sender, EventArgs e)
 {
     foreach (Album album in admin.Library.album_list)
     {
         admin.ListItem item = new admin.ListItem();
         item.Text  = album.name;
         item.Value = album;
         cbxAlbum.Items.Add(item);
     }
     if (cbxAlbum.Items.Count > 0)
     {
         cbxAlbum.SelectedIndex = 0;
         btnOk.Enabled          = true;
     }
     else
     {
         btnOk.Enabled = false;
     }
 }
Ejemplo n.º 5
0
 private void frmEdit_Album_Load(object sender, EventArgs e)
 {
     try
     {
         foreach (Artist artist in admin.Library.artist_list)
         {
             admin.ListItem item = new admin.ListItem();
             item.Text  = artist.name;
             item.Value = artist;
             cbxArtist.Items.Add(item);
         }
         if (cbxArtist.Items.Count > 0)
         {
             cbxArtist.SelectedIndex = 0;
             int index = 0;
             foreach (admin.ListItem item in cbxArtist.Items)
             {
                 if (((Artist)item.Value).id == artist_id)
                 {
                     cbxArtist.SelectedIndex = index;
                     break;
                 }
                 index++;
             }
             btnOk.Enabled = true;
         }
         else
         {
             btnOk.Enabled = false;
         }
         txtAlbumName.Text    = album_name;
         txtCoverURL.Text     = cover_url;
         txtAlbumURLName.Text = album_url_name;
         lblAlbumId.Text      = "id: " + album_id;
         lblArtistId.Text     = "Artist id: " + artist_id;
     }
     catch { }
 }
Ejemplo n.º 6
0
 private void frmAdd_Album_Load(object sender, EventArgs e)
 {
     try
     {
         foreach (Artist artist in admin.Library.artist_list)
         {
             admin.ListItem item = new admin.ListItem();
             item.Text  = artist.name;
             item.Value = artist;
             cbxArtist.Items.Add(item);
         }
         if (cbxArtist.Items.Count > 0)
         {
             btnOk.Enabled           = true;
             cbxArtist.SelectedIndex = 0;
         }
         else
         {
             btnOk.Enabled = false;
         }
     }
     catch { }
 }
Ejemplo n.º 7
0
 private void FillComboAlbum()
 {
     cbxSongAlbum.Items.Clear();
     cbxSongAlbum.Items.Add(admin.Todos);
     if (cbxSongArtist.Text == admin.Todos)
     {
         foreach (Album album in admin.Library.album_list)
         {
             admin.ListItem item = new admin.ListItem();
             item.Text  = album.name;
             item.Value = album;
             cbxSongAlbum.Items.Add(item);
         }
     }
     else
     {
         try
         {
             Artist artist = (Artist)((admin.ListItem)cbxSongArtist.SelectedItem).Value;
             foreach (Album album in admin.Library.album_list)
             {
                 if (album.artist_id == artist.id)
                 {
                     admin.ListItem item = new admin.ListItem();
                     item.Text  = album.name;
                     item.Value = album;
                     cbxSongAlbum.Items.Add(item);
                 }
             }
         }
         catch
         {
         }
     }
     cbxSongAlbum.SelectedIndex = 0;
 }
Ejemplo n.º 8
0
        private void frmEdit_Song_Load(object sender, EventArgs e)
        {
            txtSongName.Text    = song_name;
            txtSongURLName.Text = song_url_name;
            txtFileName.Text    = song_file_name;
            lblSongId.Text      = "id: " + song_id;
            lblAlbumId.Text     = "Album id: " + album_id;

            foreach (Album album in admin.Library.album_list)
            {
                admin.ListItem item = new admin.ListItem();
                item.Text  = album.name;
                item.Value = album;
                cbxAlbum.Items.Add(item);
            }

            if (cbxAlbum.Items.Count > 0)
            {
                int index = 0;
                cbxAlbum.SelectedIndex = 0;
                foreach (admin.ListItem item in cbxAlbum.Items)
                {
                    if (((Album)item.Value).id == album_id)
                    {
                        cbxAlbum.SelectedIndex = index;
                        return;
                    }
                    index++;
                }
                btnOk.Enabled = true;
            }
            else
            {
                btnOk.Enabled = false;
            }
        }