Ejemplo n.º 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");
 }
Ejemplo n.º 2
0
        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");
        }
Ejemplo n.º 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");
 }
Ejemplo n.º 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();
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
     }
 }
Ejemplo n.º 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");
     }
 }
Ejemplo n.º 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());
        }
Ejemplo n.º 9
0
 /// <summary>
 /// Effacer un produit
 /// </summary>
 /// <param name="prd_id">UInt32</param>
 public static void DeleteProduct(UInt32 prd_id)
 {
     ProductDal.Delete(prd_id);
 }
Ejemplo n.º 10
0
        public void Delete(int id)
        {
            ProductDal dao = new ProductDal();

            dao.Delete(id);
        }