private void yenileToolStripMenuItem_Click(object sender, EventArgs e)
        {
            YoneticiSayfasi ys = new YoneticiSayfasi();

            ys.Show();
            this.Hide();
        }
        private void button1_Click(object sender, EventArgs e)
        {
            string user = txtkadi.Text;
            string pass = txtsifre.Text;

            con = new SqlConnection("server=DESKTOP-E2KP3SH\\MSSQLSERVER01; Initial Catalog=TeknikServis;Integrated Security=SSPI");
            cmd = new SqlCommand();
            con.Open();
            cmd.Connection  = con;
            cmd.CommandText = "SELECT * FROM Kullanicilar where kullaniciAdi='" + txtkadi.Text + "' AND parola='" + txtsifre.Text + "'";
            dr = cmd.ExecuteReader();

            if (dr.Read())
            {
                string yetki;
                yetki = dr["yetki"].ToString();
                if (yetki == "1")
                {
                    MessageBox.Show("Tebrikler! Başarılı bir şekilde giriş yaptınız.");
                    bool       isActive = true;
                    string     kayit    = "update Kullanicilar set IsActive=@IsActive where ad=@ad";
                    SqlCommand komut    = new SqlCommand(kayit, con);
                    komut.Parameters.AddWithValue("@IsActive", isActive);
                    YoneticiSayfasi ysfrm = new YoneticiSayfasi();
                    ysfrm.Show();
                    this.Hide();
                }
                else
                {
                    MessageBox.Show("Kullanıcı adı veya şifreniziz hatalı lütfen kontrol ediniz.");
                }
            }
            else
            {
                MessageBox.Show("Kullanıcı adını ve şifrenizi kontrol ediniz.");
            }
            con.Close();
        }