public static string ConvertToString(TourTypesEnum tourType)
        {
            switch (tourType)
            {
            case TourTypesEnum.Beach:
                return(beach);

            case TourTypesEnum.Bus:
                return(bus);

            case TourTypesEnum.Corporate:
                return(corporate);

            case TourTypesEnum.Individual:
                return(individual);

            case TourTypesEnum.NewYear:
                return(newYear);

            case TourTypesEnum.Skiing:
                return(skiing);

            default: throw new UnknownTourTypeException();
            }
        }
Esempio n. 2
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);
        }
Esempio n. 3
0
        public ICountry GetCountry(TourTypesEnum tourType, string countryUrl)
        {
            var tourTypeData     = TourTypesEnumConverter.ConvertToDbValue(tourType);
            var countryDataModel = _countryDataManager.GetCountry(tourTypeData, countryUrl);

            if (countryDataModel == null)
            {
                throw new CountryNotFoundException();
            }

            var country = new CountryModel(countryDataModel, _countryDataManager);

            return(country);
        }
Esempio n. 4
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);
        }
Esempio n. 5
0
        public ICountry CreateCountry(
            string name,
            string urlName,
            TourTypesEnum category,
            decimal threeStarsPrice,
            decimal fourStarsPrice,
            decimal fiveStarsPrice,
            string description,
            string pageContent)
        {
            var country = new CountryModel(
                _countryDataManager,
                name,
                urlName,
                category,
                threeStarsPrice,
                fourStarsPrice,
                fiveStarsPrice,
                description,
                pageContent
                );

            return(country);
        }