public IHttpActionResult Delete(int id) { var result = repo.Delete(id); if (result.Status == RepositoryActionStatus.Deleted) { return(StatusCode(HttpStatusCode.NoContent)); } else if (result.Status == RepositoryActionStatus.NotFound) { return(NotFound()); } return(BadRequest()); }
/// <summary> /// delete a banner /// </summary> /// <param name="id">identifier of banner</param> /// <returns>returns the result to action</returns> public ActionResult Delete(int id) { BannerRepository objbanner = new BannerRepository(SessionCustom); objbanner.Entity.BannerId = id; objbanner.LoadByKey(); if (objbanner.Entity.Bannertype != 2) { string path = Path.Combine(Server.MapPath("~"), @"resources\banners\" + objbanner.Entity.Bannerfile); if (System.IO.File.Exists(path)) { System.IO.File.Delete(path); } } objbanner.Delete(); this.InsertAudit("Delete", this.Module.Name + " -> " + id); return(this.RedirectToAction("Index", "Banner")); }
public void DeleteBanner(int id) { var repo = new BannerRepository(); repo.Delete(id); }
public JsonResult Delete(int id) { return(Json(new { mess = _re.Delete(id, User.GetClaimValue(ClaimTypes.Sid)) })); }
public ResponseModel Delete(Banner banner) { return(_bannerRepository.Delete(banner)); }