Beispiel #1
0
        public int setNewVenueAndCheckinList(List <Item2> itemList, DateTime dt)
        {
            int newVenueNumber = 0;

            foreach (Item2 item in itemList)
            {
                if (!Venues.Any(venue => venue.Id == item.venue.id))
                {
                    Venues.Add(new Venue
                    {
                        Id         = item.venue.id,
                        Address    = item.venue.location.address,
                        Lat        = item.venue.location.lat,
                        Lng        = item.venue.location.lng,
                        CategoryId = item.venue.categories.FirstOrDefault().id,
                        Name       = item.venue.name
                    });
                    newVenueNumber++;
                }

                Checkins.Add(new CheckinStatistic
                {
                    Venue_FK      = item.venue.id,
                    DateTime      = dt,
                    CheckinNumber = item.venue.stats.checkinsCount,
                    UserNumber    = item.venue.stats.usersCount
                }
                             );
            }
            return(newVenueNumber);
        }
Beispiel #2
0
        private async Task LoadVenues()
        {
            if (IsBusy)
            {
                return;
            }
            IsBusy = true;

            Venues.Clear();

            try
            {
                var response = await _foursquare.GetVenues("coffee", CurrentLocation);

                foreach (var v in response.Venues)
                {
                    Venues.Add(v);
                }

                // Publish message that Venues collection has been fully loaded
                MessagingCenter.Send(this, "VenuesLoaded");
            }
            finally
            {
                IsBusy = false;
            }
        }
Beispiel #3
0
        public async void GetVenues()
        {
            var response = await Search.SearchRequest(locationHelper.position.Latitude, locationHelper.position.Longitude, 500, Query);

            Venues.Clear();
            foreach (var venue in response.venues)
            {
                Venues.Add(venue);
            }
        }
Beispiel #4
0
        public async void GetVenues(double lat, double lng)
        {
            var venues = await Venue.GetVenues(lat, lng);

            Venues.Clear();
            foreach (var venue in venues)
            {
                Venues.Add(venue);
            }
        }
 public void LoadItems()
 {
     Venues.Clear();
     foreach (Venue v in administrationService.GetVenues())
     {
         Venues.Add(new VenueVM(v, administrationService));
     }
     CurrentVenue = Venues.First();
     RaisePropertyChangedEvent(nameof(Venues));
     RaisePropertyChangedEvent(nameof(CurrentVenue));
 }
Beispiel #6
0
        public MovieTixContext()
        {
            Database.EnsureDeleted();

            var testEntity1 = new VenueEntity {
                Address   = "Madison Square Garden",
                EventName = "Bruins @ Rangers",
                MaxAisle  = "I",
                MaxRow    = 7,
                VenueId   = Guid.NewGuid(),
                Tickets   = GenerateTickets(7, 'I')
            };

            var testEntity2 = new VenueEntity
            {
                Address   = "Regal Cinema",
                EventName = "Avengers: Endgame",
                MaxAisle  = "F",
                MaxRow    = 6,
                VenueId   = Guid.NewGuid(),
                Tickets   = GenerateTickets(6, 'F')
            };

            var testEntity3 = new VenueEntity
            {
                Address   = "Alamo Drafthouse",
                EventName = "Monty Python and the Holy Grail",
                MaxAisle  = "D",
                MaxRow    = 8,
                VenueId   = Guid.NewGuid(),
                Tickets   = GenerateTickets(8, 'D')
            };

            Venues.Add(testEntity1);
            Venues.Add(testEntity2);
            Venues.Add(testEntity3);

            SaveChanges();
        }
        private async Task LoadVenues()
        {
            if (IsBusy)
            {
                return;
            }
            IsBusy = true;

            Venues.Clear();

            try
            {
                var response = await _foursquare.GetVenues("coffee", CurrentLocation);

                //var response = new VenuesResponse();
                //response.Venues = new List<Venue>();
                //response.Venues.Add(new Venue
                //{
                //    Name = "Test 1",
                //    Id = "1",
                //    Address = new VenueAddress {Address = "123 Main Street", City = "Somewhere", State = "VA"}
                //});
                //response.Venues.Add(new Venue
                //{
                //    Name = "Test 2",
                //    Id = "2",
                //    Address = new VenueAddress {Address = "123 Main Street", City = "Somewhere", State = "VA"}
                //});

                foreach (var v in response.Venues)
                {
                    Venues.Add(v);
                }
            }
            finally
            {
                IsBusy = false;
            }
        }
        protected override void ExecuteInsertVenueCommand(string[] commandWords)
        {
            switch (commandWords[2])
            {
            case "opera":
                var opera = new Opera(commandWords[3], commandWords[4], int.Parse(commandWords[5]));
                Venues.Add(opera);
                break;

            case "sports_hall":
                var sportsHall = new SportsHall(commandWords[3], commandWords[4], int.Parse(commandWords[5]));
                Venues.Add(sportsHall);
                break;

            case "concert_hall":
                var concertHall = new ConcertHall(commandWords[3], commandWords[4], int.Parse(commandWords[5]));
                Venues.Add(concertHall);
                break;

            default:
                base.ExecuteInsertVenueCommand(commandWords);
                break;
            }
        }
Beispiel #9
0
        public void GetVenues(GeoCoordinate location)
        {
            if (_previousLocaiton != null)
            {
                if (_previousLocaiton.GetDistanceTo(location) < 100.0)
                {
                    return;
                }
            }

            if (_foursquareBot == null)
            {
                IoC.Get <IMTProtoService>().ResolveUsernameAsync(new TLString("foursquare"),
                                                                 result =>
                {
                    if (result.Peer is TLPeerUser && result.Users.Count > 0)
                    {
                        _foursquareBot = result.Users[0];
                        GetVenues(location);
                    }
                });

                return;
            }
            IsWorking = true;
            Status    = Venues.Count > 0 ? Status : AppResources.Loading;
            IoC.Get <IMTProtoService>().GetInlineBotResultsAsync(
                _foursquareBot.ToInputUser(),
                new TLInputPeerSelf(),
                new TLInputGeoPoint {
                Lat = new TLDouble(location.Latitude), Long = new TLDouble(location.Longitude)
            },
                TLString.Empty, TLString.Empty,
                result =>
            {
                _previousLocaiton = location;

                var venues = new List <TLMessageMediaVenue>();
                foreach (var inlineResult in result.Results)
                {
                    var inlineMessageMediaVenue = inlineResult.SendMessage as TLBotInlineMessageMediaVenue78;
                    if (inlineMessageMediaVenue == null)
                    {
                        continue;
                    }

                    Uri iconSource = null;
                    if (!TLString.IsNullOrEmpty(inlineMessageMediaVenue.VenueType))
                    {
                        // get icon with provided size (32, 44, 64 or 88)
                        // https://foursquare.com/img/categories_v2/food/icecream_bg_32.png
                        //
                        iconSource = new Uri(string.Format(Constants.FoursquireCategoryIconUrl, inlineMessageMediaVenue.VenueType, 64));
                    }

                    var mediaVenue = new TLMessageMediaVenue72
                    {
                        VenueId    = inlineMessageMediaVenue.VenueId,
                        Title      = inlineMessageMediaVenue.Title,
                        Address    = inlineMessageMediaVenue.Address,
                        Provider   = inlineMessageMediaVenue.Provider,
                        Geo        = inlineMessageMediaVenue.Geo,
                        VenueType  = inlineMessageMediaVenue.VenueType,
                        IconSource = iconSource
                    };

                    venues.Add(mediaVenue);
                }

                Execute.BeginOnUIThread(() =>
                {
                    Venues.Clear();
                    foreach (var venue in venues)
                    {
                        Venues.Add(venue);
                    }

                    IsWorking = false;
                    Status    = Venues.Count > 0 ? AppResources.NearbyPlaces : AppResources.NoResults;
                });
            },
                error => Execute.BeginOnUIThread(() =>
            {
                IsWorking = false;
                Venues.Clear();
                Status = AppResources.NoResults;
            }));
        }
Beispiel #10
0
 public MarketFilter WithVenue(string venue)
 {
     Venues ??= new HashSet <string>();
     Venues.Add(venue);
     return(this);
 }
 public Venue AddVenue(Venue venue)
 {
     venue.VenueId = Venues.Any() ? Venues.Max(v => v.VenueId) + 1 : 1;
     Venues.Add(venue);
     return(venue);
 }
Beispiel #12
0
 public MapModel(VenueTeamRow venue) : this()
 {
     Venues.Add(venue);
     PrepareSingleVenue();
 }