Пример #1
0
        public ITour CreateTour(
            string name,
            string urlName,
            string city,
            TourTypesEnum category,
            decimal price,
            int stars,
            string description,
            string country,
            int nights,
            bool isFlightIncluded)
        {
            var tour = new TourModel(
                _tourDataManager,
                _imageDataManager,
                name,
                urlName,
                city,
                category,
                price,
                stars,
                description,
                country,
                nights,
                isFlightIncluded
                );

            return(tour);
        }
Пример #2
0
        public ITour GetTour(int id)
        {
            var tourDataModel = _tourDataManager.GetTour(id);

            if (tourDataModel == null)
            {
                throw new TourNotFoundException();
            }

            var tour = new TourModel(tourDataModel, _tourDataManager, _imageDataManager);

            return(tour);
        }
Пример #3
0
        public ITour GetTour(TourTypesEnum tourType, string countryUrl, string tourUrl)
        {
            var tourTypeData  = TourTypesEnumConverter.ConvertToDbValue(tourType);
            var tourDataModel = _tourDataManager.GetTour(tourTypeData, countryUrl, tourUrl);

            if (tourDataModel == null)
            {
                throw new TourNotFoundException();
            }

            var tour = new TourModel(tourDataModel, _tourDataManager, _imageDataManager);

            return(tour);
        }