public ActionResult OnDelete(int id) { var result = BannerService.Delete(id); SetFlashMessage(result == Result.Ok ? "Xóa banner thành công." : "Banner không tồn tại trên hệ thống."); return(RedirectToAction("Index")); }
public HttpResponseMessage Delete(int id) { HttpResponseMessage result = null; try { bannerService.Delete(id); result = Request.CreateResponse(HttpStatusCode.OK, "Entry was deleted."); } catch (Exception ex) { Trace.TraceError(ex.Message, ex); result = Request.CreateResponse <string>(HttpStatusCode.InternalServerError, ex.Message); } return(result); }