Exemplo n.º 1
0
        private void btn_ekle_Click(object sender, EventArgs e)
        {
            BusinessLogicLayer.BLL bll         = new BusinessLogicLayer.BLL();
            List <Kelime>          KelimeListe = bll.KelimeListele();


            if (KelimeListe != null)
            {
                for (int i = 0; i < KelimeListe.Count; i++)
                {
                    if (KelimeListe[i].KelimeIngilizce == txt_ekleKelime.Text)
                    {
                        durum = true;
                        break;
                    }
                }
            }

            if (durum == false)
            {
                bll.KelimeEkle(txt_ekleKelime.Text, txt_ekleAnlam.Text, txt_ekleTur.Text, txt_ekleCumle.Text);
                MessageBox.Show("Yeni Kayit Eklendi", "Bilgilendirme", MessageBoxButtons.OK, MessageBoxIcon.Information);
                txt_ekleKelime.Text = "";
                txt_ekleAnlam.Text  = "";
                txt_ekleTur.Text    = "";
                txt_ekleCumle.Text  = "";
            }
            else
            {
                MessageBox.Show("Kayıt Ekleme Başarısız. Aynı Kelimeden Bulunmaktadır.", "Bilgilendirme", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txt_ekleKelime.Text = "";
                txt_ekleAnlam.Text  = "";
                txt_ekleTur.Text    = "";
                txt_ekleCumle.Text  = "";
                durum = false;
            }
        }