Example #1
0
        private void buttonCauta_Click(object sender, EventArgs e)
        {
            dataGridAnime.DataSource = null;
            dataGridAnime.DataSource = adminAnime.GetAnimeuri();
            lblMesaj.Text            = "Introduceti numele animeului cautat:";
            lblMesaj.ForeColor       = Color.Black;
            Anime a = adminAnime.GetAnime(txtNume2.Text);

            if (a == null)
            {
                dataGridAnime.DataSource = null;
                lblMesaj.Text            = "Animeul nu a fost gasit. Introduceti altul?";
                lblMesaj.ForeColor       = Color.Red;
            }
            else
            {
                dataGridAnime.DataSource = null;
                lblMesaj.Text            = "Animeul a fost gasit. Introduceti altul?";
                lblMesaj.ForeColor       = Color.Green;
                dataGridAnime.DataSource = adminAnime.GetAnimeL(txtNume2.Text);
            }

            txtNume2.Text = String.Empty;
        }