Ejemplo n.º 1
0
        private void btn_GirisYap_Click(object sender, EventArgs e)
        {
            try
            {
                if (btn_Ogrenci.Checked)
                {
                    OgrenciBLL ogrenciBll = new OgrenciBLL();
                    int        ogrenciID  = ogrenciBll.GirisKontrolu(txt_KullaniciAd.Text, txt_Parola.Text);

                    if (ogrenciID == -1)
                    {
                        MessageBox.Show("Kullanıcı Adı/Şifre Hatalıdır..!", "Öğrenci Bilgileri Hatalıdır", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }

                    else
                    {
                        frmOgrenci ogrenciForm = new frmOgrenci();
                        ogrenciForm.ogrenciID = ogrenciID;
                        ogrenciForm.Show();
                        this.Hide();
                    }
                }
                if (btn_Ogretmen.Checked)
                {
                    OgretmenBLL ogretmenBll = new OgretmenBLL();
                    if (ogretmenBll.GirisKontrolu(txt_KullaniciAd.Text, txt_Parola.Text))
                    {
                        frmOgretmen ogretmen = new frmOgretmen();
                        ogretmen.Show();
                        this.Hide();
                    }
                    else
                    {
                        MessageBox.Show("Kullanıcı Adı/Şifre Hatalıdır..!", "Öğretmen Bilgileri Hatalıdır", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                }
            }
            catch (Exception)
            {
                MessageBox.Show("Eksik veya Hatalı Giriş Yaptınız.!");
            }
        }
Ejemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                var paket = groupBox1.Controls.OfType <RadioButton>()
                            .FirstOrDefault(r => r.Checked);
                var taahut = groupBox2.Controls.OfType <RadioButton>()
                             .FirstOrDefault(r => r.Checked);
                Musteri mstr = new Musteri();
                mstr.musteri_ad    = textBox1.Text;
                mstr.musteri_adres = textBox2.Text;
                mstr.musteri_tel   = maskedTextBox1.Text;
                mstr.musteri_paket = paket.Text;
                mstr.musteri_mail  = "testmail";
                mstr.musteri_sifre = "testsifre";

                OgrenciBLL bll = new OgrenciBLL();
                bll.Musteri_Ekle(mstr);
            }
            catch (Exception)
            {
                MessageBox.Show("Müşteri Eklenirken Hata Oluştu");
            }
        }
Ejemplo n.º 3
0
        public void GirisTesti()
        {
            OgrenciBLL ogrenci = new OgrenciBLL();

            Assert.AreEqual(2, ogrenci.GirisKontrolu("cihancifci", "13579"));
        }