Ejemplo n.º 1
0
        public async Task <IActionResult> DeleteConfirmed(int id)
        {
            var seasonDisplayModel = await _seasonService.LoadDisplayModel(id);

            if (seasonDisplayModel == null)
            {
                return(NotFound());
            }

            await _seasonModelStatePopulator.ValidateAndPopulateForDelete(ModelState, seasonDisplayModel.DataModel);

            if (ModelState.IsValid)
            {
                await _seasonService.DeleteSeason(id);

                return(RedirectToAction(nameof(Index)));
            }

            return(View(seasonDisplayModel));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> DeleteConfirmed(int id)
        {
            var roundDisplayModel = await _roundService.LoadDisplayModel(id);

            if (roundDisplayModel == null)
            {
                return(NotFound());
            }

            await _roundModelStatePopulator.ValidateAndPopulateForDelete(ModelState, roundDisplayModel.DataModel);

            if (ModelState.IsValid)
            {
                await _roundService.DeleteRound(id);

                return(RedirectToAction(nameof(Index), new { id = roundDisplayModel.Season }));
            }

            return(View(roundDisplayModel));
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> DeleteConfirmed(int seasonId, int teamId)
        {
            var seasonEntryDisplayModel = await _seasonEntryService.LoadDisplayModel(seasonId, teamId);

            if (seasonEntryDisplayModel == null)
            {
                return(NotFound());
            }

            await _seasonEntryModelStatePopulator.ValidateAndPopulateForDelete(ModelState, seasonEntryDisplayModel.DataModel);

            if (ModelState.IsValid)
            {
                await _seasonEntryService.DeleteSeasonEntry(seasonId, teamId);

                return(RedirectToAction(nameof(Index), new { id = seasonEntryDisplayModel.Season }));
            }

            return(View(seasonEntryDisplayModel));
        }