示例#1
0
        private void btnOnayla_Click(object sender, EventArgs e)
        {
            secilen = dataGridView1.SelectedCells[0].RowIndex;
            //Adminin onayıyla seçilen ürünün ürünler tablosuna eklenmesi.
            //SqlCommand komutEkle = new SqlCommand("insert into Urunler (UrunSahibiId,UrunAdi,UrunBirimi,UrunFiyati,UrunId) values (@p1,@p2,@p3,@p4,@p5) ",sql.Connection());
            //komutEkle.Parameters.AddWithValue("@p1", dataGridView1.Rows[secilen].Cells[0].Value.ToString());
            //komutEkle.Parameters.AddWithValue("@p2", dataGridView1.Rows[secilen].Cells[1].Value.ToString());
            //komutEkle.Parameters.AddWithValue("@p3", dataGridView1.Rows[secilen].Cells[2].Value.ToString());
            //komutEkle.Parameters.AddWithValue("@p4", dataGridView1.Rows[secilen].Cells[3].Value.ToString());
            //komutEkle.Parameters.AddWithValue("@p5", dataGridView1.Rows[secilen].Cells[4].Value.ToString());
            //komutEkle.ExecuteNonQuery();
            //sql.Connection().Close();

            SqlCommand komutEkle = new SqlCommand("Update Urunler SET UrunOnay=@p1 where UrunId=@p2", sql.Connection());

            komutEkle.Parameters.AddWithValue("@p1", true);
            komutEkle.Parameters.AddWithValue("@p2", dataGridView1.Rows[secilen].Cells[4].Value.ToString());
            komutEkle.ExecuteNonQuery();
            sql.Connection().Close();
            MessageBox.Show("Ürün onaylama işlemi başarıyla gerçekleştirildi!");



            ////Onaylanan ürünün onaylanmamış ürün tablosundan silinmesi.
            //SqlCommand komutSil = new SqlCommand("Delete From OnaylanmamisUrun Where UrunId=@a1", sql.Connection());
            //komutSil.Parameters.AddWithValue("@a1", dataGridView1.Rows[secilen].Cells[4].Value.ToString());
            //komutSil.ExecuteNonQuery();
            //sql.Connection().Close();

            AcceptProduct acceptProduct = new AcceptProduct();

            acceptProduct.Show();
            this.Hide();
        }
示例#2
0
        private void btnOnaylanmamisUrun_Click(object sender, EventArgs e)
        {
            AcceptProduct acceptProduct = new AcceptProduct(users, index);

            acceptProduct.Show();
            this.Hide();
        }
示例#3
0
        private void btnOnayla_Click(object sender, EventArgs e)
        {
            secilen = dataGridView1.SelectedCells[0].RowIndex;

            SqlCommand komutEkle = new SqlCommand("Update Urunler SET UrunOnay=@p1 where UrunId=@p2", sql.Connection());

            komutEkle.Parameters.AddWithValue("@p1", true);
            komutEkle.Parameters.AddWithValue("@p2", dataGridView1.Rows[secilen].Cells[4].Value.ToString());
            komutEkle.ExecuteNonQuery();
            sql.Connection().Close();
            MessageBox.Show("Ürün onaylama işlemi başarıyla gerçekleştirildi!");


            AcceptProduct acceptProduct = new AcceptProduct();

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