Exemplo n.º 1
0
 public IHttpActionResult Delete(int id)
 {
     if (productDal.IsThereAnyLanguage(id) == false)
     {
         return(NotFound());
     }
     else
     {
         productDal.DeleteProduct(id);
         return(Ok());
     }
 }
Exemplo n.º 2
0
        public ActionResult Delete(products pro)
        {
            try
            {
                ProductDal pd = new ProductDal();
                pd.DeleteProduct(pro.ProductID);

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
Exemplo n.º 3
0
        public IActionResult Delete(IFormCollection collection)
        {
            try
            {
                int  id     = Convert.ToInt32(collection["deleteProductId"]);
                bool result = _productDal.DeleteProduct(id);

                return(RedirectToAction("Index", "Admin", new { deleteProductResult = result }));
            }
            catch
            {
                return(View());
            }
        }
Exemplo n.º 4
0
 /// <summary>
 /// 删除产品
 /// </summary>
 /// <param name="proId"></param>
 /// <returns></returns>
 public static int DeleteProduct(int proId)
 {
     return(ProductDal.DeleteProduct(proId));
 }
Exemplo n.º 5
0
 public bool Delete(string id)
 {
     return(_infoDal.DeleteProduct(id) > 0);
 }
Exemplo n.º 6
0
        public int DeleteProduct(int dni)
        {
            var productDal = new ProductDal();

            return(productDal.DeleteProduct(dni));
        }