private void button1_Click(object sender, EventArgs e) //Adaugare - anime { if (DateValide() == false) { return; } Anime anime1 = new Anime(txtNume1.Text, txtSezoane.Text, txtEpisoade.Text, txtRecenzie.Text); TypeAnime?typeAnime = GetTypeAnime(); if (typeAnime.HasValue) { anime1.TipulAnime = typeAnime.Value; } Status?status = GetStatus(); if (status.HasValue) { anime1.OngoingAnime = status.Value; } anime1.GenAnime = new List <string>(); anime1.GenAnime.AddRange(genurileBifate); //lblMesajAdaugare.Visible = true; //lblMesajAdaugare.Text = "Animeul: " + anime1.ConvertToStringAfisare() + "A fost adaugat"; adminAnime.AddAnime(anime1); ResetareControale(); show(); }
private void buttonAdaugare_Click(object sender, EventArgs e) { if (DateValide() == false) { label2.Visible = true; label2.ForeColor = Color.DeepSkyBlue; label2.Text = "Animeul nu a putut fi adaugat"; return; } Anime anime1 = new Anime(txtNume1.Text, txtSezoane.Text, txtEpisoade.Text, txtRecenzie.Text); TypeAnime?typeAnime = GetTypeAnime(); if (typeAnime.HasValue) { anime1.TipulAnime = typeAnime.Value; } Status?status = GetStatus(); if (status.HasValue) { anime1.OngoingAnime = status.Value; } anime1.GenAnime = new List <string>(); anime1.GenAnime.AddRange(genurileBifate); adminAnime.AddAnime(anime1); if (adminAnime.GetAnime(anime1.NumeAnime) == null) { label2.Visible = true; label2.ForeColor = Color.DeepSkyBlue; label2.Text = "Animeul nu a putut fi adaugat"; } else { label2.Visible = true; label2.ForeColor = Color.DeepSkyBlue; label2.Text = "Animeul a fost adaugat"; } ResetareControale(); show(); }