Пример #1
0
        public PhishinImporter(
            DbService db,
            VenueService venueService,
            TourService tourService,
            SourceService sourceService,
            SourceSetService sourceSetService,
            SourceReviewService sourceReviewService,
            SourceTrackService sourceTrackService,
            SetlistSongService setlistSongService,
            LinkService linkService,
            SetlistShowService setlistShowService,
            EraService eraService,
            ILogger <PhishinImporter> log,
            IConfiguration configuration
            ) : base(db)
        {
            this.linkService         = linkService;
            this._setlistSongService = setlistSongService;
            this._setlistShowService = setlistShowService;
            this._sourceService      = sourceService;
            this._venueService       = venueService;
            this._tourService        = tourService;
            this._log            = log;
            _configuration       = configuration;
            _sourceReviewService = sourceReviewService;
            _sourceTrackService  = sourceTrackService;
            _sourceSetService    = sourceSetService;
            _eraService          = eraService;
            _configuration       = configuration;

            http.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", configuration["PHISHIN_KEY"]);
        }
Пример #2
0
        private void BindLists()
        {
            TourService tourService = new TourService(Ioc.GetInstance <ITourRepository>());
            //ShowService showService = new ShowService(Ioc.GetInstance<IShowRepository>());

            var tours = tourService.GetAllToursDescending().ToList();

            if (tours != null && tours.Count > 0)
            {
                tours.ForEach(x =>
                {
                    ddlFavoriteTour.Items.Add(new ListItem(x.TourName, x.TourId.ToString()));
                    ddlFavoriteLiveShowTour.Items.Add(new ListItem(x.TourName, x.TourId.ToString()));
                }
                              );

                var item = new ListItem("Please select a tour", "-1");

                ddlFavoriteTour.Items.Insert(0, item);
                ddlFavoriteLiveShowTour.Items.Insert(0, item);


                //ddlFavoriteLiveShow.Items.Insert(0, item);

                item.Selected = true;
            }
        }
        //
        public ActionResult CheckOut(tbl_Booking booking, List <tbl_Passenger> tbl_Passenger)
        {
            if (Session[UtilContants.USER_LOGIN] == null)
            {
                return(RedirectToAction("Index", "Home"));
            }
            else
            {
                try
                {
                    foreach (var item in tbl_Passenger)
                    {
                        item.isDelete = false;
                        booking.tbl_Passenger.Add(item);
                    }
                    ITourService _tourService = new TourService();

                    if (_tourService.updateSeat(booking.TourID, tbl_Passenger.Count))
                    {
                        _bookingService.SaveBooking(booking);
                        return(Json(new { status = true }));
                    }
                    else
                    {
                        return(Json(new { status = false }));
                    }
                }
                catch (Exception ee)
                {
                    return(Json(new { status = false, ee }));
                }
            }
        }
Пример #4
0
        public void btnSubmit_Click(object sender, EventArgs e)
        {
            TourService service = new TourService(Ioc.GetInstance <ITourRepository>());

            bool     success = false;
            DateTime?startDate, endDate;

            if (Validated(out startDate, out endDate))
            {
                Tour tour = new Tour()
                {
                    TourId    = Guid.NewGuid(),
                    TourName  = txtTourName.Text.Trim(),
                    StartDate = startDate,
                    EndDate   = endDate,
                    Official  = chkOfficial.Checked
                };

                service.SaveCommit(tour, out success);
            }

            if (success)
            {
                phSuccess.Visible = true;
                phError.Visible   = false;
            }
            else
            {
                phError.Visible   = true;
                phSuccess.Visible = false;
            }
        }
Пример #5
0
 public PhishinImporter(
     DbService db,
     VenueService venueService,
     TourService tourService,
     SourceService sourceService,
     SourceSetService sourceSetService,
     SourceReviewService sourceReviewService,
     SourceTrackService sourceTrackService,
     SetlistSongService setlistSongService,
     SetlistShowService setlistShowService,
     EraService eraService,
     ILogger <PhishinImporter> log
     ) : base(db)
 {
     this._setlistSongService = setlistSongService;
     this._setlistShowService = setlistShowService;
     this._sourceService      = sourceService;
     this._venueService       = venueService;
     this._tourService        = tourService;
     this._log            = log;
     _sourceReviewService = sourceReviewService;
     _sourceTrackService  = sourceTrackService;
     _sourceSetService    = sourceSetService;
     _eraService          = eraService;
 }
Пример #6
0
        public void FindByIdTestWithException()
        {
            ResetData();
            var         uow = new Mock <UnitOfWork>();
            TourService ts  = new TourService(uow.Object);

            ts.FindById(-5);
        }
Пример #7
0
        public void CreateTourTestWithException()
        {
            ResetData();
            var         uow = new Mock <UnitOfWork>();
            TourService ts  = new TourService(uow.Object);

            ts.CreateTour(null);
        }
Пример #8
0
 public CategoryController(TourCategoriesService tourCategoryService, TourService tourService, CategoryService categoryService, CategoriesSlidersService categoriesSliderService, GalleryPoolService galleryPoolService)
 {
     _categoryService         = categoryService;
     _categoriesSliderService = categoriesSliderService;
     _galleryPoolService      = galleryPoolService;
     _tourService             = tourService;
     _tourCategoryService     = tourCategoryService;
 }
Пример #9
0
 public PredictionsController()
 {
     _context           = new PredictionsContext();
     _expertService     = new ExpertService(_context);
     _tourService       = new TourService(_context);
     _predictionService = new PredictionService(_context);
     _matchService      = new MatchService(_context);
 }
Пример #10
0
 public TourController(TourGalleriesService tourGalleryService, TourService tourService, TourPlanService tourPlanService, TourCategoriesService tourCategoriesService, CategoryService categoriesService)
 {
     _tourService           = tourService;
     _tourPlanService       = tourPlanService;
     _tourCategoriesService = tourCategoriesService;
     _categoriesService     = categoriesService;
     _tourGalleryService    = tourGalleryService;
 }
Пример #11
0
 public HomeController(ILogger <HomeController> logger, KinhNghiemDuLichService kinhNghiemDuLichService,
                       LienHeService lienHeService, TinTucService tinTucService, TourService tourService)
 {
     _logger = logger;
     this._kinhNghiemDuLichService = kinhNghiemDuLichService;
     this._lienHeService           = lienHeService;
     this._tinTucService           = tinTucService;
     this._tourService             = tourService;
 }
Пример #12
0
 public ToursController(
     RedisService redis,
     DbService db,
     ArtistService artistService,
     TourService tourService
     ) : base(redis, db, artistService)
 {
     _tourService = tourService;
 }
Пример #13
0
        private Guid?BindProfile(Guid userId, string userName)
        {
            TourService    service        = new TourService(Ioc.GetInstance <ITourRepository>());
            ProfileService profileService = new ProfileService(Ioc.GetInstance <IProfileRepository>());

            var profile = profileService.GetProfileByUserId(userId);

            if (profile == null)
            {
                phNoProfileError.Visible = true;
                return(null);
            }

            //Show Profile

            //SongService songService = new SongService(Ioc.GetInstance<ISongRepository>());
            //ShowService showService = new ShowService(Ioc.GetInstance<IShowRepository>());

            //if (profile.FavoriteStudioSong != null)
            //{
            //    var favoriteStudioSong = songService.GetSong(profile.FavoriteStudioSong.Value);
            //    lblFavoriteStudioSong.Text = string.Format("{0} - {1}", favoriteStudioSong.SongName, favoriteStudioSong.Album);
            //}

            //if (profile.FavoriteLiveShow != null)
            //{
            //    var favoriteLiveShow = showService.GetShow(profile.FavoriteLiveShow.Value);
            //    lblFavoriteLiveShow.Text = string.Format("{0} - {1}, {2}", favoriteLiveShow.ShowDate.Value.ToString("MM/dd/yyyy"), favoriteLiveShow.VenueName, favoriteLiveShow.State);
            //}

            //if (profile.FavoriteTour != null)
            //{
            //    var favoriteTour = service.GetTour(profile.FavoriteTour.Value);
            //    lblFavoriteTour.Text = string.Format("{0} {1}-{2}", favoriteTour.TourName, favoriteTour.StartDate.Value.ToString("MM/dd/yyyy"), favoriteTour.EndDate.Value.ToString("MM/dd/yyyy"));
            //}

            if (profile.FavoriteAlbum != null)
            {
                var albumService = new AlbumService(Ioc.GetInstance <IAlbumRepository>());
                var album        = albumService.GetAlbum(profile.FavoriteAlbum.Value);
                lblFavoriteAlbum.Text = album.AlbumName;
            }

            lblName.Text          = profile.Name;
            lblEmail.Text         = profile.Email;
            lblFavorite3Year.Text = profile.Favorite3Year != null?profile.Favorite3Year.Value.ToString() : string.Empty;

            lblFavoriteYear.Text = profile.FavoriteYear != null?profile.FavoriteYear.Value.ToString() : string.Empty;

            lblFavoriteRun.Text    = !string.IsNullOrEmpty(profile.FavoriteRun) ? profile.FavoriteRun.ToString() : string.Empty;
            lblFavoriteSeason.Text = !string.IsNullOrEmpty(profile.FavoriteSeason) ? profile.FavoriteSeason.ToString() : string.Empty;
            lblUserName.Text       = userName;

            return(userId);
        }
Пример #14
0
 public void Setup()
 {
     _tourDalMock = new Mock <ITourDal>();
     _tourService = new TourService(_tourDalMock.Object);
     _tourList    = new List <IElement>
     {
         new Tour(Guid.NewGuid(), "Tour1", "Desc", "Start", "End", 100),
         new Tour(Guid.NewGuid(), "Tour2", "Description", "Hell", "Heaven", 666),
         new Tour(Guid.NewGuid(), "Tour3", "BESCHREIBUNG", "BEGINN", "ENDE", 300)
     };
 }
        public ShowJourneyListViewModel()
        {
            tourService = new TourService();

            Task.Run(async() =>
            {
                IsBusy = true;
                await GetAllActiveTours();
                IsBusy = false;
            });
        }
Пример #16
0
 public TourController(TourPlanService tourPlanListService, TourService tourService, CategoryService categoryService, TourCategoriesService tourCategoryService, KeywordPoolService keywordPoolService, GalleryKeywordService galleryKeywordService, GalleryPoolService galleryPoolService, TourGalleriesService tourGalleryService)
 {
     _tourService           = tourService;
     _categoryService       = categoryService;
     _tourCategoryService   = tourCategoryService;
     _keywordPoolService    = keywordPoolService;
     _galleryKeywordService = galleryKeywordService;
     _galleryPoolService    = galleryPoolService;
     _tourGalleryService    = tourGalleryService;
     _tourPlanListService   = tourPlanListService;
 }
Пример #17
0
        private void loadDataGroup()
        {
            var gID = int.Parse(cbbGroupTour.SelectedValue.ToString());

            objService = new TourService();
            var data = objService.GetList(gID);

            gridControlData.DataSource = data;
            gridControlData.Update();
            gridControlData.Refresh();
        }
Пример #18
0
        public PopularToursViewModel GetViewModel()
        {
            var service = new TourService();
            var model   = new PopularToursViewModel()
            {
                Items             = this.SelectedItem,
                Ids               = this.SelectedIds,
                PopularToursItems = service.GetItemsBySelectedIds(this.SelectedIds)
            };

            return(model);
        }
Пример #19
0
 public DatTourController(DattourService dattourService, TourService tourService,
                          IConfiguration configuration, HoaDonService hoaDonService,
                          CommonService commonService, DiaDiemService diaDiemService,
                          KhachSanService khachSanService)
 {
     this._dattourService  = dattourService;
     this._tourService     = tourService;
     this._configuration   = configuration;
     this._hoaDonService   = hoaDonService;
     this._commonService   = commonService;
     this._diaDiemService  = diaDiemService;
     this._khachSanService = khachSanService;
 }
Пример #20
0
        public void GetTours_ArrayReturned()
        {
            mock.Setup(m => m.Tours.GetAll()).Returns(tours);
            var         mapper  = new MapperConfiguration(cfg => cfg.CreateMap <Tour, TourDTO>()).CreateMapper();
            TourService service = new TourService(mock.Object);
            //ISerialize<TourDTO> serialize = new TourSerialize();

            IEnumerable <TourDTO> example = (mapper.Map <IEnumerable <Tour>, List <TourDTO> >(tours));//serialize.serializeList

            IEnumerable <TourDTO> data = service.GetTours();

            Assert.AreEqual(data.Count(), example.Count());
        }
Пример #21
0
 public PhantasyTourImporter(
     DbService db,
     VenueService venueService,
     TourService tourService,
     SetlistShowService setlistShowService,
     SetlistSongService setlistSongService
     ) : base(db)
 {
     _setlistSongService = setlistSongService;
     _setlistShowService = setlistShowService;
     _venueService       = venueService;
     _tourService        = tourService;
 }
Пример #22
0
        public void FindByIdTest()
        {
            ResetData();
            var               uow = new Mock <UnitOfWork>();
            TourService       ts  = new TourService(uow.Object);
            OutputTourService ots = new OutputTourService(uow.Object);

            TourDTO tour = ots.GetAllFilteredTours(null, null, null, false)[0];

            Assert.AreEqual(tour.Country, ts.FindById(tour.TourId).Country);
            Assert.AreEqual(tour.Region, ts.FindById(tour.TourId).Region);
            Assert.AreEqual(tour.Hotel, ts.FindById(tour.TourId).Hotel);
        }
Пример #23
0
        public void Should_Find_ByCriteria()
        {
            // Arrange
            TourStorage storage = new TourStorage();

            storage.AddTour(new TourRecord
                            (
                                1,
                                "Tour to Japan, Kyoto",
                                "Japan",
                                "Kyoto",
                                new DateTime[] { new DateTime(2018, 08, 11) },
                                new int[] { 7 },
                                new int[] { 4 },
                                4,
                                800000
                            ));
            storage.AddTour(new TourRecord
                            (
                                2,
                                "Tour to USA, Virginia",
                                "USA",
                                "Virginia",
                                new DateTime[] { new DateTime(2018, 07, 11) },
                                new int[] { 11 },
                                new int[] { 5 },
                                8,
                                300000
                            ));
            storage.AddTour(new TourRecord
                            (
                                3,
                                "Tour to USA, Virginia",
                                "USA",
                                "Virginia",
                                new DateTime[] { new DateTime(2018, 07, 25) },
                                new int[] { 12 },
                                new int[] { 7 },
                                8,
                                350000
                            ));

            TourService       service = new TourService(storage);
            TourSearchRequest request = new TourSearchRequest("Japan", new DateTime(2018, 08, 10), 2, 3);

            // Act
            List <TourRecord> filtered = service.FilterByCriteria(request);

            // Assert
            Assert.IsTrue(filtered[0].City == "Kyoto");
        }
Пример #24
0
        public void GetTourById_ValueReturned()
        {
            mock.Setup(m => m.Tours.GetAll()).Returns(tours);
            mock.Setup(m => m.Tours.Get(1)).Returns(tours.ElementAt(0));
            var         mapper  = new MapperConfiguration(cfg => cfg.CreateMap <Tour, TourDTO>()).CreateMapper();
            TourService service = new TourService(mock.Object);
            //ISerialize<TourDTO> serialize = new TourSerialize();

            //string example = serialize.serializeVary(mapper.Map<Tour, TourDTO>(tours.ElementAt(0)));

            TourDTO data = service.GetTour(1);

            Assert.IsNotNull(data);
        }
Пример #25
0
        //private readonly IMapper _mapper;

        public CurrentTournamentToursController(IPredictionsContext context, IMapper mapper)
        {
            _expertService     = new ExpertService(context);
            _tourService       = new TourService(context);
            _predictionService = new PredictionService(context);
            _matchService      = new MatchService(context, mapper);
            _teamService       = new TeamService(context);
            _tournamentService = new TournamentService(context);

            _context = context;

            // _mapper = mapper;

            _fileService = new FileService();
        }
Пример #26
0
        private void Bind()
        {
            TourService tourService = new TourService(Ioc.GetInstance <ITourRepository>());
            ShowService showService = new ShowService(Ioc.GetInstance <IShowRepository>());

            ddlTourType.Items.AddRange((from x in tourService.GetAllToursDescending() select new ListItem(x.TourName, x.TourId.ToString())).ToArray());
            ddlShowType.Items.AddRange((from x in showService.GetAllShows() select new ListItem(x.GetShowName(), x.ShowId.ToString())).ToArray());

            ListItem item = new ListItem("Please select either a tour or a song", "-1");

            ddlTourType.Items.Insert(0, item);
            ddlShowType.Items.Insert(0, item);

            item.Selected = true;
        }
Пример #27
0
 public JerryGarciaComImporter(
     DbService db,
     SetlistShowService setlistShowService,
     VenueService venueService,
     TourService tourService,
     SetlistSongService setlistSongService,
     ILogger <JerryGarciaComImporter> log
     ) : base(db)
 {
     this._setlistShowService = setlistShowService;
     this._venueService       = venueService;
     this._tourService        = tourService;
     this._setlistSongService = setlistSongService;
     this._log = log;
 }
Пример #28
0
 public AdminController(YourTourContext db, IHostingEnvironment hostingEnvironment,
                        TravelService travelService, StaffService staffService, LocationService locationService,
                        CommonService commonService, AdminService adminService, TourService tourService,
                        HoaDonService hoaDonService, LienHeService lienHeService)
 {
     this._db = db;
     this._hostingEnvironment = hostingEnvironment;
     this._travelService      = travelService;
     this._staffService       = staffService;
     this._locationService    = locationService;
     this._commonService      = commonService;
     this._adminService       = adminService;
     this._tourService        = tourService;
     this._hoaDonService      = hoaDonService;
     this._lienHeService      = lienHeService;
 }
        public void GetAllUsers_WithoutParameters_RetursAllUsers()
        {
            // Arrange
            var mock = new Mock <IUnitOfWork>();

            mock.Setup(unitOfWork => unitOfWork.TourRepository.GetAll()).Returns(GetAllTours);
            var tourService = new TourService(mock.Object);

            // Act
            var actualTours = tourService.GetAllTours();

            // Assertions
            Assert.True(actualTours.Count == 2);
            Assert.Equal(1, actualTours[0].TourId);
            Assert.Equal(2, actualTours[1].TourId);
            Assert.Equal(1, actualTours[0].Price);
            Assert.Equal("Tour2", actualTours[1].Name);
        }
Пример #30
0
        public void FindByIdTest()
        {
            ResetData();
            var               uow = new Mock <UnitOfWork>();
            TourService       ts  = new TourService(uow.Object);
            OutputTourService ots = new OutputTourService(uow.Object);

            TourDTO tour = new TourDTO()
            {
                Country = "Ukraine", Region = "Kiev", Hotel = "Ukraine", EndDate = DateTime.Now, StartDate = DateTime.Now
            };

            ts.CreateTour(tour);

            List <TourDTO> tours = ots.GetAllFilteredTours(null, null, null, false);

            Assert.AreEqual(ts.FindById(tours[tours.Count - 1].TourId).Country, tour.Country);
        }