예제 #1
0
        private void button4_Click(object sender, EventArgs e)
        {
            Albums_user newForm = new Albums_user(this.numeArtist, this.loggedArtist);

            newForm.FormClosed += new FormClosedEventHandler(closeForm);
            this.Hide();
            newForm.Show();
            newForm.Left = this.Left;
            newForm.Top  = this.Top;
        }
예제 #2
0
        private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            string numeArtist = Convert.ToString(listBox1.SelectedItem);

            if (numeArtist != "")
            {
                Albums_user newForm = new Albums_user(numeArtist, this.loggedArtist);
                newForm.FormClosed += new FormClosedEventHandler(closeForm);
                this.Hide();
                newForm.Show();
                newForm.Left = this.Left;
                newForm.Top  = this.Top;
            }
        }
예제 #3
0
        private void button3_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Are you sure ?", "Question", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                ArrayList list = new ArrayList();
                int       id   = connect.GetAlbumId(numeArtist, numeAlbum);
                list = connect.ReadSongsForAlbum(Convert.ToString(id));
                foreach (string slist in list)
                {
                    string s1  = Convert.ToString(slist);
                    int    ok1 = 1;
                    string s2  = "";
                    for (int i = 0; i < s1.Length && ok1 == 1; i++)
                    {
                        if (s1[i + 1] == '.')
                        {
                            ok1 = 0;
                        }

                        s2 = s2 + s1[i];
                    }
                    int  songIndex = connect.GetSongId(s2);
                    bool ok        = connect.DeleteSong(songIndex);
                    if (!ok)
                    {
                        MessageBox.Show("Error at deleting songs");
                    }
                }

                bool ok3 = connect.DeleteAlbum(this.numeAlbum);
                if (ok3)
                {
                    MessageBox.Show("Album Deleted");
                }
                else
                {
                    MessageBox.Show("Delete Error");
                }

                Albums_user newForm = new Albums_user(this.numeArtist, this.loggedArtist);
                newForm.FormClosed += new FormClosedEventHandler(closeForm);
                this.Hide();
                newForm.Show();
                newForm.Left = this.Left;
                newForm.Top  = this.Top;
            }
        }
예제 #4
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (textBox1.Text == "" || textBox4.Text == "" || textBox3.Text == "")
            {
                MessageBox.Show("All fields must be filled");
            }
            else
            {
                ArrayList list = connect.ReadAlbums();
                connect.UpdateAlbum(textBox1.Text, textBox4.Text, textBox3.Text, list, numeAlbumVechi);

                Albums_user newForm = new Albums_user(this.numeArtist, this.loggedArtist);
                newForm.FormClosed += new FormClosedEventHandler(closeForm);
                this.Hide();
                newForm.Show();
                newForm.Left = this.Left;
                newForm.Top  = this.Top;
            }
        }
예제 #5
0
 private void button4_Click(object sender, EventArgs e)
 {
     if (connectedUser == "admin")
     {
         Albums_admin newForm = new Albums_admin(this.numeArtist);
         newForm.FormClosed += new FormClosedEventHandler(closeForm);
         this.Hide();
         newForm.Show();
         newForm.Left = this.Left;
         newForm.Top  = this.Top;
     }
     else
     {
         Albums_user newForm = new Albums_user(this.numeArtist, connectedUser);
         newForm.FormClosed += new FormClosedEventHandler(closeForm);
         this.Hide();
         newForm.Show();
         newForm.Left = this.Left;
         newForm.Top  = this.Top;
     }
 }