private void ListBoxEventsByMinimumNumberOfParticipants_SelectedIndexChanged(object sender, EventArgs e) { if (ListBoxEventsByMinimumNumberOfParticipants.SelectedItems.Count == 1) { EventsFinderByInstance.LoadPictureAndNumberOfAttenders( ListBoxEventsByMinimumNumberOfParticipants, PictureBoxEventChosenByParticipantsNumber, TextBoxNumberOfParticipants); EventsFinderByInstance.LoadListOfAttenders(ListBoxEventsByMinimumNumberOfParticipants.SelectedItem as Event); loadAttendersList(); } }
private void ButtonClickToAttend_Click(object sender, EventArgs e) { try { if (LoggedInUser != null) { EventsFinderByInstance.AttendToEvent(ListBoxEventsByMinimumNumberOfParticipants); } else { throw new Exception("You must be logged in, in order to proceed."); } } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } }