예제 #1
0
 public void GetUserCallback(GetUserCompletedEventArgs e)
 {
     _venue = null;
     if (e.Result.venue != null)
     {
         _venue = e.Result.venue;
         _pinLocation = new Location
             {
                 Latitude = double.Parse(e.Result.venue.geolat),
                 Longitude = double.Parse(e.Result.venue.geolong),
             };
     }
     var model = new FriendDetailViewModel(e.Result);
     DataContext = model;
     if (_pinLocation != null)
     {
         MapHelper.LoadMap(LoadMapCompleted, _pinLocation.Latitude, _pinLocation.Longitude, (int)imageMap.Width,
                           (int)imageMap.Height);
     }
     else
     {
         LayoutRoot.RowDefinitions[2].Height = new GridLength(0);
     }
 }
예제 #2
0
        public static bool VenueHasStats(Venue venue)
        {
            if (venue == null || venue.stats == null)
                return false;

            return true;
        }
예제 #3
0
        public static bool VenueHasPhone(Venue venue)
        {
            if (venue == null || venue.phone == null)
                return false;

            return true;
        }
예제 #4
0
        public static bool VenueHasName(Venue venue)
        {
            if (venue == null || string.IsNullOrEmpty(venue.name))
                return false;

            return true;
        }
예제 #5
0
        public static bool VenueHasCrossStreet(Venue venue)
        {
            if (venue == null || venue.crossstreet == null)
                return false;

            return true;
        }
예제 #6
0
        public static bool VenueHasCity(Venue venue)
        {
            if (venue == null || venue.city == null)
                return false;

            return true;
        }
예제 #7
0
        public static string VenueGetCity(Venue venue)
        {
            if (venue == null || string.IsNullOrEmpty(venue.city))
                return string.Empty;

            return venue.city;
        }
        private void GetVenueCallback(GetVenueCompletedEventArgs args)
        {
            if (args.Result == null)
            {
                if (args.Error == null || string.IsNullOrEmpty(args.Error.Message))
                {
                    MessageBox.Show("Unknown error");
                    return;
                }
                MessageBox.Show(args.Error.Message);
                return;
            }
            venue = args.Result;
            CheckInButton.IsEnabled = true;

            #region data clean up

            if (string.IsNullOrEmpty(venue.address))
                venue.address = "3950 Las Vegas Blvd S";

            if (string.IsNullOrEmpty(venue.city))
                venue.city = "Las Vegas";

            if(string.IsNullOrEmpty(venue.state))
                venue.state = "NV";

            if(string.IsNullOrEmpty(venue.zip))
                venue.zip = "89119";

            CityStateZip.Text = string.Format("{0}, {1} {2}", venue.city, venue.state, venue.zip);

            if (string.IsNullOrEmpty(venue.phone) && venue.zip == "89119")
                venue.phone = "7026320648";

            if (string.IsNullOrEmpty(venue.twitter) && venue.zip == "89119")
                venue.twitter = "@LVHotels";

            if (!string.IsNullOrEmpty(venue.phone))
                venue.phone = Utilities.FormatPhoneNumber(venue.phone);

            #endregion

            VenueName.Text = venue.name;
            VenueAddress.Text = venue.address;
            CrossStreet.Text = venue.crossstreet;
            Distance.Text = venue.distance;
            Phone.Text = venue.phone;
            Twitter.Text = venue.twitter;

            string distanceStr = Cache.Get("VenueDistance") as string;
            if (distanceStr != null)
            {
                Distance.Text = distanceStr;
            }

            pinLocation = LocationHelper.ToLocation(args.Result.geolat, args.Result.geolong);
            Cache.Set("pinLocation", pinLocation);
            MapHelper.LoadMap(LoadMapCompleted, pinLocation.Latitude, pinLocation.Longitude, (int)imageMap.Width, (int)imageMap.Height);
        }
예제 #9
0
        public static int VenueGetStatsGetCheckIns(Venue venue)
        {
            if (venue == null || venue.stats == null)
                return 0;

            return venue.stats.checkins;
        }
예제 #10
0
        public static bool VenueGetStatsGetBeenHereGetMe(Venue venue)
        {
            if (venue == null || venue.stats == null || venue.stats.beenhere == null)
                return false;

            return venue.stats.beenhere.me;
        }
예제 #11
0
        public static string VenueGetState(Venue venue)
        {
            if (venue == null || string.IsNullOrEmpty(venue.state))
                return string.Empty;

            return venue.state;
        }
예제 #12
0
        public static string VenueGetPhone(Venue venue)
        {
            if (venue == null || string.IsNullOrEmpty(venue.phone))
                return string.Empty;

            return venue.phone;
        }
예제 #13
0
        public static string VenueGetDistance(Venue venue)
        {
            if (venue == null || string.IsNullOrEmpty(venue.distance))
                return string.Empty;

            return venue.distance;
        }
예제 #14
0
        public static string VenueGetCrossStreet(Venue venue)
        {
            if (venue == null || string.IsNullOrEmpty(venue.crossstreet))
                return string.Empty;

            return venue.crossstreet;
        }
예제 #15
0
        public static bool VenueHasStatsHasBeenHere(Venue venue)
        {
            if (venue == null || venue.stats == null || venue.stats.beenhere == null)
                return false;

            return true;
        }
예제 #16
0
        public static bool VenueHasZip(Venue venue)
        {
            if (venue == null || venue.zip == null)
                return false;

            return true;
        }
예제 #17
0
        public static string VenueGetZip(Venue venue)
        {
            if (venue == null || string.IsNullOrEmpty(venue.zip))
                return string.Empty;

            return venue.zip;
        }
예제 #18
0
        public static bool VenueHasAddress(Venue venue)
        {
            if (venue == null || venue.address == null)
                return false;

            return true;
        }
예제 #19
0
        public static string VenueGetAddress(Venue venue)
        {
            if (venue == null || string.IsNullOrEmpty(venue.address))
                return string.Empty;

            return venue.address;
        }