private void btnDelete_Click(object sender, EventArgs e) { _productDal.Delete(new Product { Id = Convert.ToInt32(dgwProducts.CurrentRow.Cells[0].Value) }); LoadProducts(); MessageBox.Show("Your product Deleted"); }
private void btnSellerProductsRemove_Click(object sender, EventArgs e) { ProductDal.Delete((Product)dgwSellerProducts.CurrentRow.DataBoundItem); dgwSellerProducts.DataSource = ProductDal.Select().Where(p => p.SellerId == sellerLoggedIn.Id).Where(p => p.StockAmount > 0); MessageBox.Show("Product Deleted"); }
private void btnDelete_Click(object sender, EventArgs e) { _productDal.Delete(new Product { ProductID = Convert.ToInt32(dgwProduct.CurrentRow.Cells[0].Value) }); ListProduct(); MessageBox.Show("Urun Silindi"); }
private void btnSil_Click(object sender, EventArgs e) { Product deletedProduct = new Product { Name = txtName.Text, Price = Convert.ToDecimal(txtPrice.Text), StockAmount = Convert.ToInt32(txtStock.Text), Id = Convert.ToInt32(dataGridView.CurrentRow.Cells["Id"].Value.ToString()), }; _productDal.Delete(deletedProduct); FillLoad(); }
public Product Delete(Product product) { IProductDal IproductDal = new ProductDal(); ProductDto productDto = new ProductDto { Id = product.Id, ProductId = product.ProductId, IsActive = false }; IproductDal.Delete(productDto); return(product); }
public string Delete(int productId) { try { if (productId < 1) { return("Silmek İstediğiniz Ürünü Seçiniz"); } return(productDal.Delete(productId)); } catch (Exception ex) { return(ex.Message); } }
private void btnRemove_Click(object sender, EventArgs e) { if (dgwProducts.SelectedRows.Count > 0) { dal.Delete(new Products { ID = int.Parse(dgwProducts.CurrentRow.Cells[0].Value.ToString()) }); LoadData(); MessageBox.Show("Deleted"); } else { MessageBox.Show("Satır Seçiniz"); } }
public ActionResult DeleteProduct(int PId) { string sCon = ConfigurationManager.ConnectionStrings["hihi"].ConnectionString; string query = "Delete From HistoryAuctions Where PId = " + PId; SqlConnection conn = new SqlConnection(sCon); SqlCommand command = new SqlCommand(query, conn); conn.Open(); command.ExecuteNonQuery(); conn.Close(); if (PDal.Delete(PId)) { return(RedirectToAction("Products")); } return(View()); }
/// <summary> /// Effacer un produit /// </summary> /// <param name="prd_id">UInt32</param> public static void DeleteProduct(UInt32 prd_id) { ProductDal.Delete(prd_id); }
public void Delete(int id) { ProductDal dao = new ProductDal(); dao.Delete(id); }