Ejemplo n.º 1
0
        private void btngiris1_Click(object sender, EventArgs e)
        {
            //var staff = login(txtuser.Text, txtpassword.Text);
            //if (staff == null)
            //{
            //    MessageBox.Show("Şifre Yanlış");
            //}
            //else
            //{
            //    MessageBox.Show("Giriş Başarılı");
            //    personelmenu yonetim = new personelmenu();
            //    yonetim.Show();
            //    this.Hide();

            //}
            baglanti.Open(); SqlCommand komut = new SqlCommand("select * from Staff where Username='******'and UserPassword='******'", baglanti); SqlDataReader dr = komut.ExecuteReader();
            if (txtuser.Text == "" || txtpassword.Text == "")
            {
                MessageBox.Show("Boş Alan Bırakılamaz !", "Giriş Başarısız", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else if (dr.Read())
            {
                personelmenu menu = new personelmenu(); menu.Show(); this.Hide();
            }
            else
            {
                txtuser.Clear(); txtpassword.Clear(); MessageBox.Show("Kullanıcı Adı Veya Şifre Yanlış !", "Giriş Başarısız", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            baglanti.Close();
        }
 private void pictureBox1_Click(object sender, EventArgs e)
 {
     personelmenu pm = new personelmenu(); pm.Show(); this.Hide();
 }