private void ButtonGetRecommendation_Click(object sender, EventArgs e) { try { if (LoggedInUser != null) { if (ListBoxFriendsToAsk.Items.Count != 0) { List <User> friendsToAsk = new List <User>(); foreach (User friend in ListBoxFriendsToAsk.Items) { friendsToAsk.Add(friend as User); } PlaceRecommendationsInstance.AskFriendForRecommendation(LoggedInUser, friendsToAsk, TextBoxPlace.Text); ListBoxFriendsToAsk.Items.Clear(); ListBoxFriendsThatHaveBeenInChosenPlace.Items.Clear(); } else { MessageBox.Show("There are no friends to get recommandation from."); } } else { throw new Exception("You must be logged in, in order to proceed."); } } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } }
private void ButtonAddFriensToList_Click_1(object sender, EventArgs e) { PlaceRecommendationsInstance.AddFriendsToAskToList( LoggedInUser, ListBoxFriendsThatHaveBeenInChosenPlace, ListBoxFriendsToAsk); }
private void checkPlace(string i_PlaceName) { ListBoxFriendsToAsk.Invoke(new Action(() => ListBoxFriendsToAsk.Items.Clear())); Thread threadCheckPlace = new Thread(() => PlaceRecommendationsInstance.CheckPlace( i_PlaceName, LoggedInUser, ListBoxFriendsThatHaveBeenInChosenPlace, friendsBindingSource)); threadCheckPlace.Start(); }
private void ButtonDeleteFriensFromList_Click(object sender, EventArgs e) { PlaceRecommendationsInstance.DeleteFriendsToAskFromList( LoggedInUser, ListBoxFriendsToAsk); }