bool setUpBubble(UserPin up, User u)
 {
     Popup.IsOpen = true;
     Last.Text    = Last.Text + u.lastname;
     First.Text   = First.Text + u.firstname;
     Loc.Text     = Loc.Text + up.location_name;
     Tim.Text     = Tim.Text + up.personal_message;
     return(true);
 }
 public bool self_radius(User u, UserPin up)
 {
     if (u.x_coord >= (up.x_coord - 0.0001) && u.x_coord <= (up.x_coord + 0.0001))
     {
         if (u.y_coord >= (up.y_coord - 0.0001) && u.y_coord <= (up.y_coord + 0.0001))
         {
             u.is_at_location = true;
             return(u.is_at_location);
         }
         else
         {
             return(false);
         }
     }
     else
     {
         return(false);
     }
 }
        public async void add_userpin(TappedRoutedEventArgs e, Pushpin p, int locationType, String LocationName, String message, int hour, int minute, int ampm)
        {
            var up = new UserPin()
            {
                user_id          = user_id,
                x_coord          = 0,
                y_coord          = 0,
                ampm             = ampm,
                checkin_hour     = hour,
                checkin_minute   = minute,
                location_name    = LocationName,
                personal_message = message,
                location_type    = locationType, // 0 - Study, 1 - Eat, 2 - Paste
                pp = p.TabIndex.ToString()
            };
            string      sql   = "SELECT * FROM Users WHERE id = " + user_id + " LIMIT 1";
            List <User> users = await connection.QueryAsync <User>(sql);

            drop_pushpin(users[0], e, p);
            await connection.InsertAsync(up);
        }
        public async void remove_pin(UserPin up)
        {
            up.view = false;
            string searchText = up.pp;

            Pushpin toRemove = null;

            foreach (UIElement elem in myMap.Children)
            {
                Pushpin pushPin = (Pushpin)elem;
                if (pushPin.TabIndex.ToString() == up.pp)
                {
                    toRemove = pushPin;
                }
            }

            if (toRemove != null)
            {
                myMap.Children.Remove(toRemove);
            }

            string sql = "DELETE FROM UserPins WHERE id = " + up.id;
            await connection.QueryAsync <UserPin>(sql);
        }