public Form5(anasayfa a, int id, int fiyat) { an = a; f = fiyat; InitializeComponent(); string connString = String.Format( "Server=localhost;User Id=postgres;Database=yemegimigetir;Port=5432;Password=benbuyum123;SSLMode=Prefer"); NpgsqlConnection con = new NpgsqlConnection(connString); con.Open(); using (var command = new NpgsqlCommand("SELECT kurye_adi,kurye_soyadi From kurye where kurye_magazaid=@id", con)) { command.Parameters.AddWithValue("id", id); NpgsqlDataReader dr = command.ExecuteReader(); while (dr.Read()) { string x = dr["kurye_adi"].ToString(); string y = dr["kurye_soyadi"].ToString(); x += " " + y; comboBox1.Items.Add(x); } con.Close(); } }
public siparisver(anasayfa a, int magazaID) { InitializeComponent(); an = a; mid = magazaID; InitializeComponent(); ekle(); label2.Text = "asdasq"; }
public UserControl6(string isim, int fiyat, anasayfa a) { InitializeComponent(); label1.Text = isim; label2.Text += fiyat; an = a; f = fiyat; }
private void button1_Click(object sender, EventArgs e) { string connString = String.Format( "Server=localhost;User Id=postgres;Database=yemegimigetir;Port=5432;Password=benbuyum123;SSLMode=Prefer"); using (var conn = new NpgsqlConnection(connString)) { Console.Out.WriteLine("Opening connection"); conn.Open(); using (var command = new NpgsqlCommand("SELECT kullanici_id,kullanici_tip From kullanici WHERE kullanici_kadi=@ad and kullanici_sifre=@sifre", conn)) { command.Parameters.AddWithValue("ad", textBox_kID.Text.TrimEnd()); command.Parameters.AddWithValue("sifre", textBox_parola.Text.TrimEnd()); NpgsqlDataReader dr = command.ExecuteReader(); if (dr.Read()) { if (dr["kullanici_tip"].ToString() == "musteri") { this.Hide(); anasayfa tm = new anasayfa((int)dr["kullanici_id"]); tm.Show(); } if (dr["kullanici_tip"].ToString() == "admin") { this.Hide(); Form3 tm = new Form3(); tm.Show(); } } conn.Close(); if (dr == null) { hata.Show(); } } } }
public adresEklecs(int k, anasayfa a) { an = a; kID = k; InitializeComponent(); }