private void button1_Click(object sender, EventArgs e)
        {
            admin_panel nesne = new admin_panel();

            nesne.Show();
            this.Hide();
        }
Beispiel #2
0
 private void btn_Giris_Click(object sender, EventArgs e)
 {
     using (SQLiteConnection con = new SQLiteConnection(connectionstring))
     {
         try
         {
             string ad    = textBox1.Text;
             string sifre = textBox2.Text;
             string Yetki_No;
             con.Open();
             if (con.State == ConnectionState.Open)
             {
                 cmd             = new SQLiteCommand();
                 cmd.Connection  = con;
                 cmd.CommandText = "SELECT * FROM tblKullaniciGirisi where KullaniciAdi ='" + ad + "' AND Sifre='" + sifre + "'";
                 dr = cmd.ExecuteReader();
                 if (dr.Read())
                 {
                     Yetki_No = dr["YetkiID"].ToString();
                     if (Yetki_No == "1")
                     {
                         admin_panel f2 = new admin_panel();
                         f2.Show();
                         Hide();
                     }
                     else if (Yetki_No == "2")
                     {
                         Bilet_Al f2 = new Bilet_Al();
                         f2.Show();
                         Hide();
                     }
                 }
                 else
                 {
                     MessageBox.Show("Kullanıcı adı ya da şifre yanlış");
                 }
             }
             cmd.Dispose();
             dr.Dispose();
             con.Close();
         }
         catch (Exception)
         {
             MessageBox.Show("Veritabanı ile bağlantı kurulamıyor...");
         }
     }
 }