Exemplo n.º 1
0
        public void AddVenueTest()
        {
            repo.Add(new Venue {
                name = "W.O.W. Hall", address = "291 W 8th Ave", city = "Eugene", state = "Oregon", description = "The W.O.W. Hall is a performing arts venue in Eugene, Oregon, United States. It was formerly a Woodmen of the World lodge. The W.O.W. Hall was listed on the National Register of Historic Places in 1996.", wazeNav = "https://www.waze.com/livemap?zoom=17&lat=44.05128&lon=-123.09708", googleNav = "https://www.google.com/maps/place/291+W+8th+Ave,+Eugene,+OR+97401/@44.0511031,-123.0992632,17z/data=!3m1!4b1!4m5!3m4!1s0x54c11e6ce9f47a7f:0x343f151172bdd64e!8m2!3d44.0511031!4d-123.0970745"
            });

            var count = repo.GetAllVenues().Count;

            count++;
            repo.Add(new Venue {
                name = "W.O.W. Hall", address = "291 W 8th Ave", city = "Eugene", state = "Oregon", description = "The W.O.W. Hall is a performing arts venue in Eugene, Oregon, United States. It was formerly a Woodmen of the World lodge. The W.O.W. Hall was listed on the National Register of Historic Places in 1996.", wazeNav = "https://www.waze.com/livemap?zoom=17&lat=44.05128&lon=-123.09708", googleNav = "https://www.google.com/maps/place/291+W+8th+Ave,+Eugene,+OR+97401/@44.0511031,-123.0992632,17z/data=!3m1!4b1!4m5!3m4!1s0x54c11e6ce9f47a7f:0x343f151172bdd64e!8m2!3d44.0511031!4d-123.0970745"
            });
            Assert.Equal(count, repo.GetAllVenues().Count);
        }
Exemplo n.º 2
0
        public async Task <Venue> Create(Venue venue)
        {
            await _venueRepository.Add(venue);

            await _venueRepository.Commit();

            return(venue);
        }
Exemplo n.º 3
0
        public IHttpActionResult Post([FromBody] Venue venue)
        {
            var result = new Venue();

            if (ModelState.IsValid)
            {
                result = venueRepository.Add(venue);
            }

            return(Json(result));
        }
        public Tournament Add(Tournament tournament)
        {
            Organizer organizer;

            if (tournament.Organizer == null)
            {
                organizer = organizerRepository.Add(tournament.Organizer);
            }
            else
            {
                organizer = organizerRepository.Get(tournament.Organizer.Id);
            }

            Venue venue;

            if (tournament.Venue == null)
            {
                venue = venueRepository.Add(tournament.Venue);
            }
            else
            {
                venue = venueRepository.Get(tournament.Venue.Id);
            }

            ICollection <Category> categories = new List <Category>();

            if (tournament.Categories != null && tournament.Categories.Count > 0)
            {
                foreach (Category category in tournament.Categories)
                {
                    var categoryFromDb = categoryRepository.Get(category.Id);

                    if (categoryFromDb == null)
                    {
                        categories.Add(categoryRepository.Add(category));
                    }
                    else
                    {
                        categories.Add(categoryFromDb);
                    }
                }
            }

            tournament.Organizer  = organizer;
            tournament.Venue      = venue;
            tournament.Categories = categories;

            var result = context.Tournaments.Add(tournament);

            Save();

            return(result);
        }
Exemplo n.º 5
0
        public Venue CreateVenue(MeetupVenue meetupVenue)
        {
            var venue = new Venue
            {
                Address1  = meetupVenue.Address_1,
                City      = meetupVenue.City,
                IsDeleted = false,
                MeetUpId  = meetupVenue.Id,
                Name      = meetupVenue.Name
            };

            _venueRepository.Add(venue);
            return(venue);
        }
Exemplo n.º 6
0
        public async Task <Unit> Handle(CreateEventCommand message, CancellationToken cancellationToken)
        {
            Log.Information($"Creating Event: {message.Name}");
            var e = new Event(message.EventId, message.Name);

            _eventRepository.Add(e);
            await _eventRepository.UnitOfWork.SaveEntitiesAsync(cancellationToken);

            var venue = new Venue(message.VenueId, message.EventId);

            foreach (var section in message.VenueSections.ToList())
            {
                venue.AddSection(venue.Id, section.Ordinal, section.Price, section.Rows, section.Columns);
            }

            _venueRepository.Add(venue);
            await _venueRepository.UnitOfWork.SaveEntitiesAsync(cancellationToken);

            return(Unit.Value);
        }
Exemplo n.º 7
0
 public IActionResult VenueCreate(Venue venue)
 {
     venueRepo.Add(venue);
     ViewData["Message"] = "Venue Added!";
     return(View("VenueList", venueRepo.GetAllVenues()));
 }