Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
 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);
     }
 }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        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);
        }