Beispiel #1
0
        public IActionResult DeleteAuction(int auctionId)
        {
            bool auctionHasBid = _businessService.GetAuctionHasBids(auctionId);

            if (auctionHasBid == false)
            {
                HttpResponseMessage response = _businessService.DeleteAuction(auctionId);

                return(RedirectToAction("Index", "Home", new { message = "Auction has successfully been deleted" }));
            }
            else
            {
                return(RedirectToAction("ViewAuctionDetails", "Auction", new { auctionId = auctionId, message = "Auction with bids cannot be deleted" }));
            }
        }