public ActionResult DeleteProductType(ProductType DeletedProductType, string deletingImgPath) { // deleting old image from its path : if (System.IO.File.Exists(deletingImgPath)) { System.IO.File.Delete(deletingImgPath); } bool successfullyDeletingType = DAL.DeleteProductType(DeletedProductType.ID); if (successfullyDeletingType) { return(RedirectToAction("Index", "Home")); } else { return(View(DeletedProductType)); } }
/// <summary> /// 删除商品类型 /// </summary> /// <param name="p">房间类型对象</param> /// <returns>受影响的行数</returns> public static int DeleteProductType(ProductTypeMDL p) { return(ProductTypeDAL.DeleteProductType(p)); }