Exemple #1
0
        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"));
        }
Exemple #2
0
        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);
        }