//Form üzerindeki alanlar temizleniyor
 private void Temizle()
 {
     CmbKullanici.Items.Clear();
     TxtKullanici.Clear();
     TxtParola.Clear();
     CmbKurum.Items.Clear();
     RTxtAciklama.Clear();
     CmbKullanici.Text = "Kullanıcı Seçiniz";
     CmbKurum.Text     = "Kurum Seçiniz";
 }
Exemple #2
0
 private void Temizle()
 {
     MTxtTc.Clear();
     TxtAdı.Clear();
     TxtSoyad.Clear();
     TxtParola.Clear();
     TxtDogumYeri.Clear();
     MTxtTel.Clear();
     TxtPosta.Clear();
     CmbCinsiyet.SelectedItem = null;
     TxtAdres.Clear();
     CmbYetki.SelectedItem = null;
 }
Exemple #3
0
        private void BtnKaydet_Click(object sender, EventArgs e)
        {
            baglanti.Open();
            komut = new SqlCommand("insert into Admin (YöneticiAd,YöneticiParola) values (@y,@p)", baglanti);

            komut.Parameters.AddWithValue("@y", TxtYAd.Text);
            komut.Parameters.AddWithValue("@p", TxtParola.Text);
            komut.ExecuteNonQuery();
            VerileriGoster("Select * From Admin");
            baglanti.Close();
            TxtYAd.Clear();
            TxtParola.Clear();
        }
        private void button1_Click(object sender, EventArgs e)
        {
            string          kullaniciadi = TxtKullaniciAdi.Text.ToString();
            string          parola       = TxtParola.Text.ToString();
            OleDbCommand    komut        = new OleDbCommand();
            OleDbCommand    komut1       = new OleDbCommand();
            OleDbConnection baglanti     = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\\kutuphaneveritabanı.mdb");

            baglanti.Open();
            komut.Connection  = baglanti;
            komut.CommandText = "SELECT Yetki FROM TblKullanici where KullaniciAdi='" + kullaniciadi + "' AND Parola='" + parola + "'";
            komut1.Connection = baglanti;

            var yetki = komut.ExecuteScalar();

            if (yetki != null)
            {
                if (yetki.ToString() == "Personel")
                {
                    FrmPersonel FrmPersonel = new FrmPersonel();
                    komut1.CommandText = "SELECT Id FROM TblKullanici where KullaniciAdi='" + kullaniciadi + "' AND Parola='" + parola + "'";
                    var personelId = komut1.ExecuteScalar();
                    if (personelId != null)
                    {
                        FrmPersonel.personelId = Convert.ToInt32(personelId);
                    }
                    FrmPersonel.Show();
                }
                else if (yetki.ToString() == "Üye")
                {
                    FrmUye FrmUye = new FrmUye();
                    FrmUye.Show();
                }
            }
            else
            {
                MessageBox.Show("Kullanıcı adı ya da şifre yanlış");
                TxtKullaniciAdi.Clear();
                TxtParola.Clear();
                TxtKullaniciAdi.Focus();
            }



            baglanti.Close();
        }
        private void BtnGiris_Click(object sender, EventArgs e)
        {
            SqlCommand komut = new SqlCommand("select *from admin where yoneticiad=@p1 and yoneticisifre=@p2", bgl.baglanti());

            komut.Parameters.AddWithValue("@p1", TxtKullaniciAd.Text);
            komut.Parameters.AddWithValue("@p2", TxtParola.Text);
            SqlDataReader oku = komut.ExecuteReader();

            if (oku.Read())
            {
                FrmAnaForm fr = new FrmAnaForm();
                fr.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("Kullanıcı Adı veya Parola Hatalı!");
                TxtKullaniciAd.Clear();
                TxtParola.Clear();
                TxtKullaniciAd.Focus();
            }
            bgl.baglanti().Close();
        }
Exemple #6
0
        private void button1_Click(object sender, EventArgs e)
        {
            baglanti.Open();
            SqlCommand komut = new SqlCommand("Select * From Admin Where YöneticiAd=@p1 and YöneticiParola=@p2", baglanti);

            komut.Parameters.AddWithValue("@p1", TxtKullaniciAdi.Text);
            komut.Parameters.AddWithValue("@p2", TxtParola.Text);
            SqlDataReader oku = komut.ExecuteReader();

            if (oku.Read())
            {
                AnaForm frm = new AnaForm();
                frm.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("Hatalı Giriş Yaptınız!!");
                TxtKullaniciAdi.Clear();
                TxtParola.Clear();
                TxtKullaniciAdi.Focus();
            }
            baglanti.Close();
        }