예제 #1
0
        private void btnUyeOl_Click(object sender, EventArgs e)
        {
            if (bosKontrol())
            {
                return;
            }
            kullanici kln = edm.kullanicis.SingleOrDefault(x => x.kullaniciAdi == textBox1.Text);
            kullanici kl  = new kullanici();

            if (kln != null)
            {
                lblUyelik.Text = "Kullanıcı zaten var!";
                return;
            }
            if (textBox2.TextLength < 4)
            {
                lblUyelik.Text = "Şifre en az 4 haneli olmalı!";
                return;
            }
            if (textBox5.TextLength < 11)
            {
                lblUyelik.Text = "Numaranız 11 haneli olmalı!";
                return;
            }
            kl.kullaniciAdi = textBox1.Text;
            kl.sifre        = textBox2.Text;
            kl.ad           = textBox3.Text;
            kl.soyad        = textBox4.Text;
            kl.telefon      = textBox5.Text;
            edm.kullanicis.Add(kl);
            edm.SaveChanges();
            lblUyelik.Text = "Üyelik işemi başarılı!";
        }
예제 #2
0
        private void btnGiris_Click(object sender, EventArgs e)
        {
            kullanici kl = edm.kullanicis.SingleOrDefault(x =>
                                                          x.kullaniciAdi == txtKullaniciGiris.Text &&
                                                          x.sifre == txtSifreGiris.Text);

            if (kl != null)
            {
                if (kl.rol == "Admin")
                {
                    this.Hide();
                    Admin_Paneli adm = new Admin_Paneli(kl.ID);
                    adm.Show();
                }
                else
                {
                    this.Hide();
                    KullaniciForm kf = new KullaniciForm(kl.ID);
                    kf.Show();
                }
            }

            else
            {
                lblGiris.Text = "Hata..!";
            }
        }
예제 #3
0
        private void btnHatırlat_Click(object sender, EventArgs e)
        {
            kullanici kl = edm.kullanicis.SingleOrDefault(x => x.kullaniciAdi == txtKullaniciHatirla.Text);

            if (kl != null)
            {
                lblSifreHatırla.Text = kl.sifre;
            }
            else
            {
                lblSifreHatırla.Text = "Kullanıcı bulunamadı..";
            }
        }
예제 #4
0
 private void btnHesapSil_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("Hesap silinecek!", "Uyarı", MessageBoxButtons.OKCancel, MessageBoxIcon.Hand) == DialogResult.OK)
     {
         kullanici kl = edm.kullanicis.SingleOrDefault(x => x.ID == kul_id);
         try
         {
             edm.kullanicis.Remove(kl);
             edm.SaveChanges();
             this.Hide();
             Form1 fr = new Form1();
             fr.Show();
         }
         catch { MessageBox.Show("Silme başarısız!"); };
     }
 }
예제 #5
0
        private void btnHesapGuncelle_Click(object sender, EventArgs e)
        {
            if (txtSifre.TextLength < 4)
            {
                MessageBox.Show("Şifre 4 haneden az olamaz!"); return;
            }
            if (txtTelefon.TextLength < 11)
            {
                MessageBox.Show("Telefon hatalı!"); return;
            }
            kullanici kl = edm.kullanicis.SingleOrDefault(x => x.ID == kul_id);

            kl.kullaniciAdi = txtKul_Adi.Text;
            kl.sifre        = txtSifre.Text;
            kl.ad           = txtAd.Text;
            kl.soyad        = txtSoyad.Text;
            kl.telefon      = txtTelefon.Text;
            try
            {
                edm.SaveChanges();
                MessageBox.Show("Güncelleme başarılı!", "Güncel", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch { MessageBox.Show("Bir hata oluştu!"); }
        }
예제 #6
0
        private void kullanici_bilgigetir()
        {
            kullanici kl = edm.kullanicis.SingleOrDefault(x => x.ID == kul_id);

            lblKullanici_Bilgi.Text = kl.kullaniciAdi + "\n" + kl.ad + " " + kl.soyad;
        }
예제 #7
0
        private void adminbilgigetir(int kullanici)
        {
            kullanici kl = edm.kullanicis.SingleOrDefault(x => x.ID == kullanici);

            lblAdmin_Bilgi.Text = kl.kullaniciAdi + "\n" + kl.ad + " " + kl.soyad;
        }