private void button4_Click(object sender, EventArgs e) {// kullanici girisi baglanti.Open(); string sql = "SELECT \"KullaniciAdi\", \"Sifre\" , \"KullaniciTuru\" , \"KullaniciID\" FROM \"Kullanici\""; cmd = new OdbcCommand(sql, baglanti); OdbcDataReader dr = cmd.ExecuteReader(); while (dr.Read()) { if (dr[0].ToString() == textBox4.Text && dr[1].ToString() == textBox3.Text && dr[2].ToString() == "K") { kID = dr[3].ToString(); kAdi = textBox4.Text; KullaniciPaneli panel = new KullaniciPaneli(); panel.Show(); Hide(); durum = true; break; } } if (durum == false) { MessageBox.Show("Yanlış Kullanıcı Adı/Şifre", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error); } baglanti.Close(); }
private void button2_Click(object sender, EventArgs e) { KullaniciPaneli kullanici = new KullaniciPaneli(); kullanici.Show(); Hide(); }
private void button1_Click(object sender, EventArgs e) { string sql = "INSERT INTO \"public\".\"GeriBildirim\" ( \"KullaniciID\", \"Metin\") VALUES ('" + Giris.kID + "', '" + textBox1.Text + "');"; OdbcConnection connection = new OdbcConnection("DSN=PostgreSQL35W"); try { connection.Open(); OdbcCommand cmd = new OdbcCommand(sql, connection); cmd.ExecuteNonQuery(); connection.Close(); MessageBox.Show("Geribildiriminiz Başarıyla İletildi"); KullaniciPaneli kullanici = new KullaniciPaneli(); Hide(); kullanici.Show(); } catch (Exception ex) { connection.Close(); MessageBox.Show(ex.Message); throw; } }