Esempio n. 1
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);
     }
 }