// Displays the all the users sorted by "match"
        private void DisplayListings(View view)
        {
            mListings = new List <Profile> ();
            // Change to get the listings
            foreach (Profile listing in db.Query <Profile>("SELECT * FROM Profile"))
            {
                // Check if the listings are posted by the user and not display them
                if (listing.StudentID != mCurrentUser.StudentID && !(db.Query <Accommodation>("SELECT * FROM Accommodation WHERE ID = '" + listing.AccommodationID + "'")[0].Suburb.Equals(String.Empty)))
                {
                    mListings.Add(listing);
                }
            }

            // Change to check listing owner's interests against the
            mListings = mListings.OrderByDescending(user => user.GetRank(mCurrentUser)).ToList();
//			// store the accommodation class of each selected profile class
//			var myAccommodationList = new List<Accommodation> ();
//			foreach (Profile profile in mListings) {
//				myAccommodationList.Add (db.Query<Accommodation>("SELECT * FROM Accommodation WHERE ID = '" + profile.AccommodationID + "'")[0]);
//			}

            // Add users to the mUsers list
            // Inflate the listview with the mUsers list
            mListingsList         = view.FindViewById <ListView>(Resource.Id.listAccommodation);
            mAdapter              = new AccommodationAdapter(Activity, mListings, mCurrentUser);
            mListingsList.Adapter = mAdapter;
        }
Exemplo n.º 2
0
 public AccommodationFilter(AccommodationAdapter adapter)
 {
     mAdapter = adapter;
 }