예제 #1
0
        private void btn_product_DeleteProduct_Click(object sender, EventArgs e)
        {
            try
            {
                Product product = new Product();
                product.SetId(Convert.ToInt32(dataGridView_productsOfSeller.CurrentRow.Cells["ProductId"].Value));

                DialogResult dialog = MessageBox.Show("Delete Selected Product.", "Okey", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (dialog == DialogResult.Yes)
                {
                    DbProduct.DeleteSelectedProduct(product);
                }
                fill_dataGridView_by_productsOfSeller();
                fill_product_detail();
                comment_list_index = 1; //index sıfırlanmış oldu
            }
            catch (Exception)
            {
                throw;
            }
        }