Ejemplo n.º 1
0
        private void btnEkle_Click(object sender, EventArgs e)
        {
            DBcrud  kayit   = new DBcrud();
            Ogrenci ogrenci = new Ogrenci();


            bool uyemi = kayit.uyevarmi(textBox1.Text);

            if (uyemi == false)
            {
                ogrenci.ad    = txtAd.Text;
                ogrenci.soyad = txtSoyad.Text;
                ogrenci.TC    = textBox1.Text;
                ogrenci.sifre = txtSifre.Text;
                ogrenci.email = txtEmail.Text;
                ogrenci.bolum = cmbBolum.Text;
                ogrenci.sinif = textBox2.Text;

                bool kontrol = kayit.kayit(ogrenci);
                if (kontrol == true)
                {
                    MessageBox.Show("Kayıt Eklendi...");
                    temizle();
                    Form2 frm = new Form2();
                    frm.Show();
                    this.Hide();
                }
            }
            else
            {
                MessageBox.Show("Zaten Kayıt Var!");
                Form2 frm = new Form2();
                frm.Show();
                this.Hide();
            }
        }