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", TxtYetkiliAdi.Text);
            komut.Parameters.AddWithValue("@p2", TxtYetkiliSifre.Text);
            komut.ExecuteNonQuery();
            SqlDataReader oku = komut.ExecuteReader();

            if (oku.Read())
            {
                FrmAnaForm fr = new FrmAnaForm();
                fr.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("Hata!!");
                TxtYetkiliAdi.Clear();
                TxtYetkiliSifre.Clear();
                TxtYetkiliAdi.Focus();
            }


            bgl.baglanti().Close();
        }
Exemple #2
0
        private void BtnGiris_Click(object sender, EventArgs e)
        {
            SqlCommand kmt = new SqlCommand("select * from Admin where YöneticiAd=@p1 and YöneticiSifre=@p2", bgl.baglanti());

            kmt.Parameters.AddWithValue("@p1", txtKullanıcıAdi.Text);
            kmt.Parameters.AddWithValue("@p2", txtSifre.Text);
            SqlDataReader oku = kmt.ExecuteReader();

            if (oku.Read())
            {
                FrmAnaForm fr = new FrmAnaForm();
                fr.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("Hatalı Kullanıcı Adı yada Şifre ");
                txtKullanıcıAdi.Clear();
                txtSifre.Clear();
                txtKullanıcıAdi.Focus();
            }
        }
        private void btnGiris_Click(object sender, EventArgs e)
        {
            SqlCommand cmd = new SqlCommand("select * from Admin where YoneticiAd=@p1 and YoneticiSifre=@p2", con.baglanti());

            cmd.Parameters.AddWithValue("@p1", txtKullaniciAd.Text);
            cmd.Parameters.AddWithValue("@p2", txtSifre.Text);
            SqlDataReader oku = cmd.ExecuteReader();

            if (oku.Read())
            {
                FrmAnaForm fr = new FrmAnaForm();
                fr.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("Hatalı kullanıcı adı ya da şifre girdiniz", "Öğrenci Yurt Otomasyonu", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtKullaniciAd.Clear();
                txtSifre.Clear();
                txtKullaniciAd.Focus();
            }
            con.baglanti().Close();
        }
Exemple #4
0
        private void button1_Click(object sender, EventArgs e)
        {
            SqlCommand command = new SqlCommand("select * from Admin where YoneticiAd=@p1 and YoneticiSifre=@p2", conn.connect());

            command.Parameters.AddWithValue("@p1", TxtKullaniciAdi.Text);
            command.Parameters.AddWithValue("@p2", TxtSifre.Text);
            SqlDataReader read = command.ExecuteReader();

            if (read.Read())
            {
                FrmAnaForm fr = new FrmAnaForm();
                fr.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("Kullanıcı Adı veya Şifre Hatalı");
                TxtKullaniciAdi.Clear();
                TxtSifre.Clear();
                TxtKullaniciAdi.Focus();
            }
            conn.connect().Close();
        }
        private void BtnGirisYap_Click(object sender, EventArgs e)
        {
            SqlCommand komut = new SqlCommand("select * from admin where yöneticiAd=@p1 and yöneticiSifre=@p2", bgl.baglanti());

            komut.Parameters.AddWithValue("@p1", TxtKullanıciAd.Text);
            komut.Parameters.AddWithValue("@p2", TxtSifre.Text);
            SqlDataReader oku = komut.ExecuteReader();

            if (oku.Read())
            {
                FrmAnaForm fr = new FrmAnaForm();
                fr.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("Hatalı kullanıcı adı ya da şifre");
                TxtKullanıciAd.Clear();
                TxtSifre.Clear();
                TxtKullanıciAd.Focus();
            }
            bgl.baglanti().Close();
        }