Пример #1
0
 private void btn_Kullanici_Girisi_Click(object sender, EventArgs e)
 {
     if (Properties.Settings.Default.Kullanici_Idsi != 0)
     {
         Kullanici_Sayfasi_Formu = new Kullanici_Sayfasi(Convert.ToInt32(Properties.Settings.Default.Kullanici_Idsi));
         Kullanici_Sayfasi_Formu.Show();
         this.Hide();
     }
     else
     {
         Kullanici_Girisi Kullanici_Girisi_Formu = new Kullanici_Girisi();
         Kullanici_Girisi_Formu.Show();
         this.Hide();
     }
 }
        private SqlDataReader kullanici_Giris(TextBox kullaniciadi, TextBox sifre)
        {
            ////////////////////////////if (!(Properties.Settings.Default.Kullanici_Idsi==null))
            ////////////////////////////{
            ////////////////////////////    ////Kullanici_Sayfasi_Formu.Show();
            ////////////////////////////    ////this.Hide();

            ////////////////////////////}
            baglanti.Open();
            komut             = new SqlCommand();
            komut.Connection  = baglanti;
            komut.CommandText = "select * from Kullanici_Bilgi where Id_numarasi ='" + kullaniciadi.Text + "'";
            oku = komut.ExecuteReader();
            if (oku.Read() == true)
            {
                if (sifre.Text.Trim() == oku["sifre"].ToString().Trim())
                {
                    MessageBox.Show("Giris basarili");
                    Kullanici_Sayfasi_Formu = new Kullanici_Sayfasi((int)oku["Kullanici_Idsi"]);


                    // Kullanici_Primer_Idsi();



                    Kullanici_Sayfasi_Formu.Show();
                    this.Hide();
                }
                else
                {
                    MessageBox.Show("Sifrenizi kontrol ediniz ", "Hata1");
                    this.Show();
                }
            }
            else
            {
                MessageBox.Show("Bilgilerinizi kontrol ediniz !", "Hata 2 ");
                this.Show();
            }
            baglanti.Close();
            return(oku);
        }