Ejemplo n.º 1
0
        private void GirisYap_Click(object sender, EventArgs e)
        {
            OleDbConnection con = new OleDbConnection(kodlar.Yol());

            con.Open();
            string           sql = "select * from uyeler where Tc=@Tc and Sifre=@Sifre";
            DataTable        dt  = new DataTable();
            OleDbDataAdapter adp = new OleDbDataAdapter(sql, con);

            adp.SelectCommand.Parameters.AddWithValue("@Tc", kullanici.Text);
            adp.SelectCommand.Parameters.AddWithValue("@Sifre", sifre.Text);
            adp.Fill(dt);

            if (dt.Rows.Count == 0)
            {
                MessageBox.Show("Hatalı Giriş Yaptınız. Lütfen Bilgilerinizi Kontrol Edin", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else
            {
                Yetki = dt.Rows[0]["Yetki"].ToString();
                if (Yetki == "Üye" || Yetki == "Yetkili")
                {
                    kullanici uyeForm = new kullanici();
                    uyeForm.Show();
                    Giris ac = (Giris)((Panel)Parent).Parent;
                    ac.Hide();
                }
                else
                {
                    MessageBox.Show("Üyeliğiniz Aktifleştirilmemiş Olabilir. Lütfen Yetkililerle İletişime Geçin.", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
        }
Ejemplo n.º 2
0
        private void GirisYap_Click(object sender, EventArgs e)
        {
            OleDbConnection con = new OleDbConnection(kodlar.Yol());

            con.Open();
            string           sql = "select * from uyeler where Tc=@Tc and Sifre=@Sifre";
            DataTable        dt  = new DataTable();
            OleDbDataAdapter adp = new OleDbDataAdapter(sql, con);

            adp.SelectCommand.Parameters.AddWithValue("@Tc", kullanici.Text);
            adp.SelectCommand.Parameters.AddWithValue("@Sifre", sifre.Text);
            adp.Fill(dt);

            if (dt.Rows.Count == 0)
            {
                MessageBox.Show("Hatalı Giriş Yaptınız. Lütfen Bilgilerinizi Kontrol Edin", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else
            {
                Yetki = dt.Rows[0]["Yetki"].ToString();
                if (Yetki == "Yetkili")
                {
                    kutuphaneAnasayfa ana = new kutuphaneAnasayfa();
                    ana.Show();
                    Giris ac = (Giris)((Panel)Parent).Parent;
                    ac.Hide();
                }
                else
                {
                    MessageBox.Show("Giriş Yetkiniz Bulunmamaktadır. Lütfen tekrar giriş yapmayı Deneyin.", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
        }