public async Task <IActionResult> DeleteProduct(string id) { var auction = HttpContext.Items["auction"] as AuctionDto; await _auctionService.DeleteAuction(auction); return(NoContent()); }
public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } var auction = _auctionService.FindAuction(id.Value); _auctionService.DeleteAuction(auction); return(RedirectToAction("Index", "Home", null)); }
public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } var auction = _auctionService.FindAuction(id.Value); if (auction.Seller_Id != Convert.ToInt32(Session["UserId"])) { _auctionService.DeleteAuction(auction); return(RedirectToAction("Index", "Home", null)); } else { return(Content("You cant delete others auctions")); } }
public async Task <ActionResult> Delete(int id) { await _auctionService.DeleteAuction(id); return(NoContent()); }
public ActionResult DeleteAuction(int id) { auctionService.DeleteAuction(id); return(RedirectToAction("AdminAuctions")); }