Esempio n. 1
0
        public bool KullaniciGirisi(Kullanicilar kullanici, YonetimPaneli menuForm, Label lbl)
        {
            ConnectionControl();
            bool durum;

            SqlCommand command = new SqlCommand("SELECT * FROM Kullanicilar WHERE KullaniciAdi=@kullaniciadi AND Sifre=@sifre", conn);

            command.Parameters.AddWithValue("kullaniciadi", kullanici.KullaniciAdi);
            command.Parameters.AddWithValue("sifre", kullanici.Sifre);
            SqlDataReader reader = command.ExecuteReader();

            if (reader.Read())
            {
                menuForm.Show();
                durum = true;
            }

            else
            {
                lbl.Text = "Kullanıcı adı veya şifreniz hatalı!";
                durum    = false;
            }



            reader.Close();
            conn.Close();

            return(durum);
        }
Esempio n. 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            YonetimPaneli yf        = new YonetimPaneli();
            Menu          m         = new Menu();
            Kullanicilar  kullanici = new Kullanicilar(tbxUser.Text, tbxPassword.Text);
            KargoDBDal    islemler  = new KargoDBDal();

            if (islemler.KullaniciGirisi(kullanici, yf, lblKullaniciMesaj) == true)
            {
                m.Close();
                this.Hide();
            }
        }