public IHttpActionResult Delete(int id) { if (productDal.IsThereAnyLanguage(id) == false) { return(NotFound()); } else { productDal.DeleteProduct(id); return(Ok()); } }
public ActionResult Delete(products pro) { try { ProductDal pd = new ProductDal(); pd.DeleteProduct(pro.ProductID); return(RedirectToAction("Index")); } catch { return(View()); } }
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()); } }
/// <summary> /// 删除产品 /// </summary> /// <param name="proId"></param> /// <returns></returns> public static int DeleteProduct(int proId) { return(ProductDal.DeleteProduct(proId)); }
public bool Delete(string id) { return(_infoDal.DeleteProduct(id) > 0); }
public int DeleteProduct(int dni) { var productDal = new ProductDal(); return(productDal.DeleteProduct(dni)); }