private void button2_Click(object sender, EventArgs e) { if (textBox1.Text == "" || textBox4.Text == "" || textBox3.Text == "") { MessageBox.Show("All fields must be filled"); } else { int albumId = connect.GetAlbumId(this.numeArtist, textBox4.Text); bool ok = connect.AddAward(textBox1.Text, Convert.ToDateTime(textBox3.Text), albumId); if (ok) { MessageBox.Show("Award Added"); 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 { MessageBox.Show("Award could not be added"); } } }
private void button3_Click(object sender, EventArgs e) { Albums_admin newForm = new Albums_admin(this.artistName); newForm.FormClosed += new FormClosedEventHandler(closeForm); this.Hide(); newForm.Show(); newForm.Left = this.Left; newForm.Top = this.Top; }
private void listBox1_SelectedIndexChanged(object sender, EventArgs e) { string numeArtist = Convert.ToString(listBox1.SelectedItem); if (numeArtist != "") { Albums_admin newForm = new Albums_admin(numeArtist); newForm.FormClosed += new FormClosedEventHandler(closeForm); this.Hide(); newForm.Show(); newForm.Left = this.Left; newForm.Top = this.Top; } }
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_admin newForm = new Albums_admin(this.numeArtist); newForm.FormClosed += new FormClosedEventHandler(closeForm); this.Hide(); newForm.Show(); newForm.Left = this.Left; newForm.Top = this.Top; } }
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_admin newForm = new Albums_admin(this.numeArtist); newForm.FormClosed += new FormClosedEventHandler(closeForm); this.Hide(); newForm.Show(); newForm.Left = this.Left; newForm.Top = this.Top; } }
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; } }