private void buttonStergere_Click(object sender, EventArgs e) { Anime a = adminAnime.GetAnime(ListaAnime.SelectedIndex); adminAnime.DeleteAnime(a); show(); ResetareControale(); }
private void buttonStergere_Click(object sender, EventArgs e) { if (ListaAnime.SelectedIndex == 0 || ListaAnime.SelectedIndex == -1) { return; } Anime a = adminAnime.GetAnime(ListaAnime.SelectedIndex); if (adminAnime.DeleteAnime(a) == false) { label2.Visible = true; label2.ForeColor = Color.DeepSkyBlue; label2.Text = "Nici un anime nu a fost sters"; } else { label2.Visible = true; label2.ForeColor = Color.DeepSkyBlue; label2.Text = "Animeul selectat a fost sters"; } show(); }