Esempio n. 1
0
 private void textBox2_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         try
         {
             string kullanici = "select * from Kullanici where KullaniciAdi='" + textBox1.Text + "' and Sifre='" + textBox2.Text + "'";
             if (DataBase.select(kullanici).Rows.Count > 0)
             {
                 DataTable table  = DataBase.select(kullanici);
                 Anasayfa  anasyf = new Anasayfa();
                 kullaniciadi = table.Rows[0]["Adi"].ToString() + " " + table.Rows[0]["Soyadi"].ToString();
                 mail         = table.Rows[0]["Email"].ToString();
                 kullaniciid  = table.Rows[0]["KullaniciId"].ToString();
                 anasyf.Show();
                 this.Hide();
             }
             else
             {
                 MessageBox.Show("Kullanıcı Adı Veya Şifre Yanlış");
             }
         }
         catch (Exception)
         {
             MessageBox.Show("Geçersiz!");
         }
     }
 }
        private void button3_Click(object sender, EventArgs e)
        {
            Anasayfa anasayfa = new Anasayfa();

            anasayfa.Show();
            this.Close();
        }
Esempio n. 3
0
        private void button2_Click(object sender, EventArgs e)
        {
            Anasayfa anasyf = new Anasayfa();

            anasyf.Show();
            this.Hide();
        }
        private void button1_Click(object sender, EventArgs e)
        {
            string    sorgu = "Select * from SifremiUnuttum where Kid=" + kullaniciid;
            DataTable table = DataBase.select(sorgu);

            if (table.Rows[0]["Kod"].ToString() == SifreKoduTxt.Text)
            {
                if (YeniSifreTxt.Text != YeniSifreTekrarTxt.Text)
                {
                    MessageBox.Show("Şifreler Uyuşmuyor..");
                    return;
                }
                else
                {
                    string degistir = "Update Kullanici set Sifre='" + YeniSifreTxt.Text + "' where KullaniciId=" + kullaniciid;
                    DataBase.ExecSql(degistir);
                    MessageBox.Show("Değiştirildi");
                    string    deger    = "Select * from Kullanici where KullaniciId=" + kullaniciid;
                    DataTable tbl      = DataBase.select(deger);
                    Anasayfa  anasayfa = new Anasayfa();
                    anasayfa.sfrunuttum = tbl.Rows[0]["KullaniciId"].ToString();
                    string kodsil = "Update SifremiUnuttum set Guncelleme_Tarih='" + DateTime.Today.ToString("yyyy-MM-dd") + "',Durum=0 where Kid=" + kullaniciid;
                    DataBase.ExecSql(kodsil);
                    anasayfa.Show();
                    this.Hide();
                }
            }
            else
            {
                MessageBox.Show("Girdiğiniz Kod Yanlış");
            }
        }
Esempio n. 5
0
 private void button1_Click_1(object sender, EventArgs e)
 {
     try
     {
         string    kullaniciadi = "select * from Kullanici where KullaniciAdi='" + textBox1.Text + "'";
         DataTable tbl          = DataBase.select(kullaniciadi);
         if (tbl.Rows.Count > 0)
         {
             string sifreyenilemekontrol = "Select * from SifremiUnuttum where Kid='" + tbl.Rows[0]["KullaniciId"].ToString() + "' and Durum=1";
             if (DataBase.select(sifreyenilemekontrol).Rows.Count > 0)
             {
                 MessageBox.Show("Daha Önceden Şifre Yenileme İsteğinde Bulunduğunuz İçin Şifre Yenileme Sayfasına Yönlendiriliyorsunuz");
                 frmSifreYenilemeKod sifreYenilemeKod = new frmSifreYenilemeKod();
                 sifreYenilemeKod.kullaniciid = tbl.Rows[0]["KullaniciId"].ToString();
                 sifreYenilemeKod.Show();
                 return;
             }
             string kullanici = "select * from Kullanici where KullaniciAdi='" + textBox1.Text + "' and Sifre='" + textBox2.Text + "'";
             if (DataBase.select(kullanici).Rows.Count > 0)
             {
                 table = DataBase.select(kullanici);
                 Anasayfa anasyf = new Anasayfa();
                 anasyf.kladi = table.Rows[0]["Adi"].ToString() + " " + table.Rows[0]["Soyadi"].ToString();
                 mail         = table.Rows[0]["Email"].ToString();
                 kullaniciid  = table.Rows[0]["KullaniciId"].ToString();
                 anasyf.Show();
                 this.Hide();
             }
             else
             {
                 MessageBox.Show("Kullanıcı Adı Veya Şifre Yanlış");
             }
         }
         else
         {
             MessageBox.Show("Kullanıcı Adı Veya Şifre Yanlış");
         }
     }
     catch (Exception hata)
     {
         MessageBox.Show(hata.Message);
     }
 }