예제 #1
0
        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());
        }
예제 #2
0
        /// <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"));
        }
예제 #3
0
        public void DeleteBanner(int id)
        {
            var repo = new BannerRepository();

            repo.Delete(id);
        }
예제 #4
0
 public JsonResult Delete(int id)
 {
     return(Json(new { mess = _re.Delete(id, User.GetClaimValue(ClaimTypes.Sid)) }));
 }
예제 #5
0
 public ResponseModel Delete(Banner banner)
 {
     return(_bannerRepository.Delete(banner));
 }