//Evento DeleteButton_Click
        private void btn_pnlCollections_Delete_Click(object sender, EventArgs e)
        {
            var confirmResult = MessageBox.Show("Are you sure to delete this item?",
                                                "Confirm Delete!",
                                                MessageBoxButtons.YesNo);

            if (confirmResult == DialogResult.Yes)
            {
                if (listView_pnlCollections_Albuns.SelectedItems.Count > 0)
                {
                    var       codigo     = listView_pnlCollections_Albuns.Items[listView_pnlCollections_Albuns.SelectedItems[0].Index].SubItems[4];
                    MidiaType album_type = (MidiaType)comboBox_pnlCollections_ColecaoSelecionada.SelectedItem;

                    switch (album_type)
                    {
                    case MidiaType.TAPE:
                        new_factory = new TapeFactory();
                        new_factory.EraseMidia(int.Parse(codigo.Text));

                        break;

                    case MidiaType.VINYL:
                        new_factory = new VinylFactory();
                        new_factory.EraseMidia(int.Parse(codigo.Text));

                        break;

                    case MidiaType.CD:
                        new_factory = new CDFactory();
                        new_factory.EraseMidia(int.Parse(codigo.Text));

                        break;

                    case MidiaType.DVD:
                        new_factory = new DVDFactory();
                        new_factory.EraseMidia(int.Parse(codigo.Text));

                        break;

                    case MidiaType.BLURAY:
                        new_factory = new BluRayFactory();
                        new_factory.EraseMidia(int.Parse(codigo.Text));

                        break;

                    case MidiaType.VCR:
                        new_factory = new VCRFactory();
                        new_factory.EraseMidia(int.Parse(codigo.Text));

                        break;
                    }
                }
            }
            else
            {
                // If 'No', do something here.
            }
            listView_pnlCollections_Albuns.Items.Clear();
            PopulateLV();
        }
        private void btn_pnlNewAlbum_saveNewAlbum_Click(object sender, EventArgs e)
        {
            //Recebe o tipo de midia selecionado na combo box
            MidiaType album_type = (MidiaType)comboBox_pnlNewAlbum_albumType.SelectedItem;


            switch (album_type)
            {
            case MidiaType.TAPE:
                new_factory = new TapeFactory();
                new_factory.CreateMidia(album_type, tb_pnlNewAlbum_albumTitle.Text);

                break;

            case MidiaType.VINYL:
                new_factory = new VinylFactory();
                new_factory.CreateMidia(album_type, tb_pnlNewAlbum_albumTitle.Text);

                break;

            case MidiaType.CD:
                new_factory = new CDFactory();
                new_factory.CreateMidia(album_type, tb_pnlNewAlbum_albumTitle.Text);

                break;

            case MidiaType.DVD:
                new_factory = new DVDFactory();
                new_factory.CreateMidia(album_type, tb_pnlNewAlbum_albumTitle.Text);

                break;

            case MidiaType.BLURAY:
                new_factory = new BluRayFactory();
                new_factory.CreateMidia(album_type, tb_pnlNewAlbum_albumTitle.Text);

                break;

            case MidiaType.VCR:
                new_factory = new VCRFactory();
                new_factory.CreateMidia(album_type, tb_pnlNewAlbum_albumTitle.Text);

                break;
            }

            panel_NewAlbum.Visible = false;
        }
        /// <summary>
        /// /Chama o Factory.UpdateMidia para atualizar dados sobre albuns
        /// </summary>
        private void UploadAlbumData()
        {
            if (listView_pnlCollections_Albuns.SelectedItems.Count > 0 && tb_pnlCollections_NomeAlbum.Text != "")
            {
                var       codigo     = listView_pnlCollections_Albuns.Items[listView_pnlCollections_Albuns.SelectedItems[0].Index].SubItems[4];
                MidiaType album_type = (MidiaType)comboBox_pnlCollections_ColecaoSelecionada.SelectedItem;

                switch (album_type)
                {
                case MidiaType.TAPE:
                    new_factory = new TapeFactory();
                    new_factory.EditMidia(int.Parse(codigo.Text), tb_pnlCollections_NomeAlbum.Text, tb_pnlCollections_Artista.Text,
                                          int.Parse(tb_pnlCollections_AnoLancamento.Text), tb_pnlCollections_Gravadora.Text, tb_pnlCollections_Publisher.Text,
                                          int.Parse(tb_pnlCollections_QtdFaixas.Text), float.Parse(tb_pnlCollections_ValorCompra.Text), comboBox_pnlCollections_Genero.Text,
                                          int.Parse(tb_pnlCollections_Estrelas.Text));

                    break;

                case MidiaType.VINYL:
                    new_factory = new VinylFactory();
                    new_factory.EditMidia(int.Parse(codigo.Text), tb_pnlCollections_NomeAlbum.Text, tb_pnlCollections_Artista.Text,
                                          int.Parse(tb_pnlCollections_AnoLancamento.Text), tb_pnlCollections_Gravadora.Text, tb_pnlCollections_Publisher.Text,
                                          int.Parse(tb_pnlCollections_QtdFaixas.Text), float.Parse(tb_pnlCollections_ValorCompra.Text), comboBox_pnlCollections_Genero.Text,
                                          int.Parse(tb_pnlCollections_Estrelas.Text));

                    break;

                case MidiaType.CD:
                    new_factory = new CDFactory();
                    new_factory.EditMidia(int.Parse(codigo.Text), tb_pnlCollections_NomeAlbum.Text, tb_pnlCollections_Artista.Text,
                                          int.Parse(tb_pnlCollections_AnoLancamento.Text), tb_pnlCollections_Gravadora.Text, tb_pnlCollections_Publisher.Text,
                                          int.Parse(tb_pnlCollections_QtdFaixas.Text), float.Parse(tb_pnlCollections_ValorCompra.Text), comboBox_pnlCollections_Genero.Text,
                                          int.Parse(tb_pnlCollections_Estrelas.Text));

                    break;

                case MidiaType.DVD:
                    new_factory = new DVDFactory();
                    new_factory.EditMidia(int.Parse(codigo.Text), tb_pnlCollections_NomeAlbum.Text, tb_pnlCollections_Artista.Text,
                                          int.Parse(tb_pnlCollections_AnoLancamento.Text), tb_pnlCollections_Gravadora.Text, tb_pnlCollections_Publisher.Text,
                                          int.Parse(tb_pnlCollections_QtdFaixas.Text), float.Parse(tb_pnlCollections_ValorCompra.Text), comboBox_pnlCollections_Genero.Text,
                                          int.Parse(tb_pnlCollections_Estrelas.Text));

                    break;

                case MidiaType.BLURAY:
                    new_factory = new BluRayFactory();
                    new_factory.EditMidia(int.Parse(codigo.Text), tb_pnlCollections_NomeAlbum.Text, tb_pnlCollections_Artista.Text,
                                          int.Parse(tb_pnlCollections_AnoLancamento.Text), tb_pnlCollections_Gravadora.Text, tb_pnlCollections_Publisher.Text,
                                          int.Parse(tb_pnlCollections_QtdFaixas.Text), float.Parse(tb_pnlCollections_ValorCompra.Text), comboBox_pnlCollections_Genero.Text,
                                          int.Parse(tb_pnlCollections_Estrelas.Text));

                    break;

                case MidiaType.VCR:
                    new_factory = new VCRFactory();
                    new_factory.EditMidia(int.Parse(codigo.Text), tb_pnlCollections_NomeAlbum.Text, tb_pnlCollections_Artista.Text,
                                          int.Parse(tb_pnlCollections_AnoLancamento.Text), tb_pnlCollections_Gravadora.Text, tb_pnlCollections_Publisher.Text,
                                          int.Parse(tb_pnlCollections_QtdFaixas.Text), float.Parse(tb_pnlCollections_ValorCompra.Text), comboBox_pnlCollections_Genero.Text,
                                          int.Parse(tb_pnlCollections_Estrelas.Text));

                    break;
                }
            }
        }