private void IlanVerBtn_Click(object sender, EventArgs e) { AnaPanel anaPanel = new AnaPanel(); anaPanel.Close(); IlanEkle ilanEkle = new IlanEkle(); ilanEkle.Show(); }
private void bunifuThinButton21_Click(object sender, EventArgs e) { if (baglanti.State == ConnectionState.Closed) { baglanti.Open(); try { string GirisKomut = "SELECT KullaniciAd,KullaniciID FROM Kullanicilar WHERE KullaniciNick=@kullaniciAdi AND KullaniciSifre=@sifre";//KULLANICI KONTROLU YAPILIYOR. SqlCommand komut = new SqlCommand(GirisKomut, baglanti); komut.Parameters.AddWithValue("@kullaniciAdi", kadiText.Text); komut.Parameters.AddWithValue("@sifre", sifreText.Text); komut.ExecuteNonQuery(); SqlDataReader dr = komut.ExecuteReader(); if (dr.Read()) { aktifKullanici = dr[0].ToString(); aktifKullanciID = Convert.ToInt16(dr[1]); AnaPanel pnl = new AnaPanel(); KullaniciBilgileri kb = new KullaniciBilgileri(); kb.label1.Text = "şuanki ID" + aktifKullanciID.ToString(); pnl.linkLabel1.Text = "Hoşgeldin " + aktifKullanici.ToString() + " " + aktifKullanciID; pnl.aktifkullaniciID = aktifKullanciID; //kb.aktifKullaniciID = aktifKullanciID.ToString(); pnl.ShowDialog(); baglanti.Close(); dr.Close(); } else { for (int i = 0; i < 1000; i++) { this.Top += 5; this.Left += 5; this.Top -= 5; this.Left -= 5; i++; } MessageBox.Show("ŞİFRE VEYA KULLANİCİ ADI YANLIŞ"); } } catch (Exception hata) { MessageBox.Show("HATA VAR" + hata); } } }