Exemplo n.º 1
0
        private void BtnDelete_Click(object sender, EventArgs e)
        {
            if (product != null)
            {
                productRepository.Delete(product);
                foreach (ProductCategory item in productCategoryRepository.Where(x => x.ProductID == product.ID))
                {
                    productCategoryRepository.Delete(item);
                }

                foreach (ProductDetail item in productDetailRepository.Where(x => x.ProductID == product.ID))
                {
                    productDetailRepository.Delete(item);
                }

                UncheckAllItems(flpAttribute);
                UncheckAllItems(flpCategory);
                ListBoxLoad();
            }
            else
            {
                MessageBox.Show("Ürün Seçiniz!");
            }
        }