Пример #1
0
        public ActionResult Delete(int concertId)
        {
            Concert concert = repository.Concerts.FirstOrDefault(m => m.ConcertId == concertId);

            if (concert != null)
            {
                repository.DeleteConcert(concert);
                TempData["message"] = string.Format("{0} was deleted", concert.ConcertId);
            }
            return(RedirectToAction("Index"));
        }
        private bool DeleteEvent(EventAdministrationViewModel viewModel)
        {
            if (viewModel.EventId <= 0)
            {
                DisplayMessage("Event name is required to delete. Cannot Continue.");
                return(false);
            }

            _concertRepository.DeleteConcert(viewModel.EventId);
            return(true);
        }