public ActionResult Delete(int id)
        {
            Tour deletedTour = repository.DeleteTour(id);

            if (deletedTour != null)
            {
                TempData["message"] = string.Format("Тур с ID \"{0}\" был удален", id);
            }
            return(RedirectToAction("Index"));
        }
Exemple #2
0
        public IActionResult DeleteTour(int id)
        {
            Tour tour = _tourRepository.GetTourById(id);

            if (tour != null)
            {
                ImageHelper.DeleteImage(_hostingEnvironment, tour.Img);
                _tourRepository.DeleteTour(tour);
            }
            return(Redirect("/Home/Index"));
        }
Exemple #3
0
 public Tournament DeleteTournament(Tournament Tour)
 {
     try
     {
         _tourVali.CheckIfTournamentIsNull(Tour);
         return(_tourRepo.DeleteTour(Tour));
     }catch (Exception ex)
     {
         throw ex;
     }
 }
        public async Task <IActionResult> DeleteTour(int id, string returnUrl)
        {
            Tour tour = _tourRepository.GetTourById(id);

            if (tour != null)
            {
                ImageHelper.DeleteImage(_hostingEnvironment, tour.Img);
                _tourRepository.DeleteTour(tour);
            }
            if (!string.IsNullOrEmpty(returnUrl))
            {
                return(Redirect(returnUrl));
            }
            else
            {
                return(RedirectToAction("TourList"));
            }
        }
Exemple #5
0
 public bool DeleteTour(int tourId)
 {
     return(_tourRepository.DeleteTour(tourId));
 }