Exemplo n.º 1
0
        public IActionResult Delete(int StadiumID)
        {
            StadiumModel StadiumDetails = _StadiumServices.GetStadiumDetails(StadiumID);

            if (StadiumDetails != null)
            {
                _StadiumServices.DeleteStadium(StadiumID);
                return(new OkResult());
            }
            return(NotFound());
        }
Exemplo n.º 2
0
 public ActionResult DeleteConfirm(int?id)
 {
     try
     {
         stadiumService.DeleteStadium(id);
         return(RedirectToAction("Index"));
     }
     catch (ValidationException ex)
     {
         return(Content(ex.Message));
     }
 }
Exemplo n.º 3
0
        public IActionResult StadiumDeleted(int id)
        {
            if (!ModelState.IsValid)
            {
                ModelState.AddModelError(string.Empty, "Something went wrong");
                ViewBag.Schools = _clubService.GetAllClubs();
                return(View("EditStadium", _StadiumService.GetSingleStadiumById(id)));
            }

            _logger.LogInformation("Model state VALID");

            _StadiumService.DeleteStadium(id);

            _logger.LogInformation("StadiumController- Stadium succesfully deleted.");

            return(RedirectToAction("AllStadiums"));
        }