Example #1
0
        private void update_btn_Click(object sender, EventArgs e)
        {
            urun_guncelle guncelle = new urun_guncelle(kAdi);

            this.Hide();
            guncelle.Show();
        }
Example #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            conn.Open();
            if (!(adet.Text.Equals(string.Empty)))
            {
                string        kayit = "update urun set stok_miktari=@adet where Id=@Id";
                NpgsqlCommand komut = new NpgsqlCommand(kayit, conn);
                komut.Parameters.AddWithValue("@adet", adet.Text);
                komut.Parameters.AddWithValue("@Id", urun_Id);
                komut.ExecuteNonQuery();
            }

            if (!(fiyat.Text.Equals(string.Empty)))
            {
                string        kayit2 = "update urun set fiyat=@fiyat where Id=@Id";
                NpgsqlCommand komut2 = new NpgsqlCommand(kayit2, conn);
                komut2.Parameters.AddWithValue("@fiyat", fiyat.Text);
                komut2.Parameters.AddWithValue("@Id", urun_Id);
                komut2.ExecuteNonQuery();
            }

            conn.Close();
            urun_guncelle guncelle = new urun_guncelle(kAdi);

            this.Hide();
            guncelle.Show();
        }