public ActionResult DeleteSupplier(int id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } if (supplier.DeleteSupplier(id) == false) { return(HttpNotFound()); } supplier.DeleteSupplier(id); return(RedirectToAction("Index")); }
public JsonResult Delete(SupplierActionModel model) { JsonResult json = new JsonResult(); var result = false; var supplier = services.GetSupplierByID(model.SupplierID); result = services.DeleteSupplier(supplier); if (result) { json.Data = new { Success = true }; } else { json.Data = new { Success = false, Message = "Unable to perform any action" }; } return(json); }