public bool Delete(int productId) { ProductBsn productBsn = new ProductBsn(); var result = productBsn.Delete(productId); return(result); }
//private void button3_Click(object sender, EventArgs e) //{ // CategoriesBsn categoriesBsn = new CategoriesBsn(); // CategoriesModel categoriesModel = categoriesBsn.getCategoryByNameBsn(comboBox1.SelectedItem.ToString()); // int categoryId = Convert.ToInt32(categoriesModel.CategoryId); // BrandsBsn brandsBsn = new BrandsBsn(); // BrandsModel brandsModel = brandsBsn.getBrandByNameBsn(comboBox2.SelectedItem.ToString()); // int brandId = Convert.ToInt32(brandsModel.BrandId); // ProductModel productModelU = new ProductModel(textBox1.Text, categoryId, brandId, Convert.ToInt32(textBox2.Text), Convert.ToDecimal(textBox3.Text)); // int idU = Convert.ToInt32(textBox4.Text); // productBsn.Update(idU, productModelU); //} private void button4_Click(object sender, EventArgs e) { int idD = Convert.ToInt32(textBox4.Text);; productBsn.Delete(idD); }