示例#1
0
 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");
        }
示例#3
0
 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");
 }
示例#4
0
        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();
        }
示例#5
0
        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);
        }
示例#6
0
 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);
     }
 }
示例#7
0
 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");
     }
 }
示例#8
0
        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());
        }
示例#9
0
 /// <summary>
 /// Effacer un produit
 /// </summary>
 /// <param name="prd_id">UInt32</param>
 public static void DeleteProduct(UInt32 prd_id)
 {
     ProductDal.Delete(prd_id);
 }
示例#10
0
        public void Delete(int id)
        {
            ProductDal dao = new ProductDal();

            dao.Delete(id);
        }