// Check For Starting Events For This Curent User public void checkForStartingEvent() { Organiser o = new Organiser(this); Participant p = new Participant(this); Facilitator f = new Facilitator(this); List<EventEntity> listOfOrganizedEvents = o.getOrganisedEvents(); List<EventEntity> listOfRegisteredEvents = p.getRegisteredEvents(); List<EventEntity> listOfFacilitatingEvents = f.getFacilitatedEvents(); EventEntity eve = new EventEntity(); TimeSpan difference = new TimeSpan(1, 0, 0, 0); foreach (EventEntity events in listOfOrganizedEvents) { if ((events.getEventStartTime().Subtract(System.DateTime.Now)) <= difference) events.setEventStartFlag(events.getEventId()); } foreach (EventEntity events in listOfRegisteredEvents) { if ((events.getEventStartTime().Subtract(System.DateTime.Now)) <= difference) events.setEventStartFlag(events.getEventId()); } foreach (EventEntity events in listOfFacilitatingEvents) { if ((events.getEventStartTime().Subtract(System.DateTime.Now)) <= difference) events.setEventStartFlag(events.getEventId()); } }
private void leaveBtn_MouseClick(object sender, MouseEventArgs e) { //Facilitator leave event int facilitatorCancellingEventId = -1; try { ListViewItem sideListItem = this.listSideEventView.SelectedItems[0]; facilitatorCancellingEventId = int.Parse(sideListItem.SubItems[0].Text); Facilitator facilitator = new Facilitator(currentUser); if (facilitatorCancellingEventId > 0) { if (Facilitator_Leave_SideBar_Dialog()) { facilitator.cancelJoinEvent(facilitatorCancellingEventId); } } } catch (ArgumentOutOfRangeException arg_ex) { AdviseUserToMakeASelection(); } //Refresh the Side Bar initSideEventBar(); }
public void initSideEventBar() { this.listSideEventView.Hide(); this.listSideEventView.Alignment = ListViewAlignment.Top; //Clear Side ListBox Columns and Items this.listSideEventView.Columns.Clear(); this.listSideEventView.Items.Clear(); //Insert Date and EventId Column this.listSideEventView.Columns.Insert(0, "Id", 0, HorizontalAlignment.Left); this.listSideEventView.Columns.Insert(1, "Date", 80, HorizontalAlignment.Center); this.listSideEventView.Columns.Insert(2, "Event", 200, HorizontalAlignment.Left); List<EventEntity> sideBarEventListing; //Get the value of the DDL selected value switch (eventCatComboBox.SelectedIndex) { case 0: //Participant Action Participant currentParticipant = new Participant(currentUser); sideBarEventListing = currentParticipant.getRegisteredEvents(); break; case 1: Organiser currentOrganiser = new Organiser(currentUser); sideBarEventListing = currentOrganiser.getOrganisedEvents(); break; case 2: Facilitator currentFacilitator = new Facilitator(currentUser); sideBarEventListing = currentFacilitator.getFacilitatedEvents(); break; default: sideBarEventListing = new List<EventEntity>(0); break; } for (int i = 0; i < sideBarEventListing.Count; i++) { EventEntity outputEvent = sideBarEventListing[i]; ListViewItem newEvent = new ListViewItem(outputEvent.getEventId().ToString()); newEvent.SubItems.Add(outputEvent.getEventDate().ToString("dd/MM/yy")); newEvent.SubItems.Add(outputEvent.getEventName()); listSideEventView.Items.Add(newEvent); } this.listSideEventView.Show(); }
// Alert Search public int scoutAlert() { int numOfAlerts = 0; userAlerts.Clear(); Participant p = new Participant(this); Facilitator f = new Facilitator(this); Organiser o = new Organiser(this); List<EventEntity> listOfRegisteredEvents = new List<EventEntity>(); List<EventEntity> listOfFacilitatingEvents = new List<EventEntity>(); List<EventEntity> listOfOrganizingEvents = new List<EventEntity>(); EventEntity eve = new EventEntity(); listOfFacilitatingEvents = f.getFacilitatedEvents(); listOfOrganizingEvents = o.getOrganisedEvents(); listOfRegisteredEvents = p.getRegisteredEvents(); // Alert if User is PARTICIPANT of this updated event foreach (EventEntity e in listOfRegisteredEvents) { if (e.getEventUpdatedFlag(e.getEventId()) == true) { userAlerts.Add(eve.createAlert(e.getEventId(), 1)); numOfAlerts++; } } // Alert if User if FACILITATOR of this updated event foreach (EventEntity e in listOfFacilitatingEvents) { if (e.getEventUpdatedFlag(e.getEventId()) == true) { userAlerts.Add(eve.createAlert(e.getEventId(), 1)); numOfAlerts++; } } // Alert if User is PARTICIPANT of this starting event foreach (EventEntity e in listOfRegisteredEvents) { if (e.getEventStartFlag(e.getEventId()) == true) { userAlerts.Add(eve.createAlert(e.getEventId(), 3)); numOfAlerts++; } } // Alert if User is FACILITATOR of this starting event foreach (EventEntity e in listOfFacilitatingEvents) { if (e.getEventStartFlag(e.getEventId()) == true) { userAlerts.Add(eve.createAlert(e.getEventId(), 3)); numOfAlerts++; } } // Alert if User is ORGANIZER of this starting event foreach (EventEntity e in listOfOrganizingEvents) { if (e.getEventStartFlag(e.getEventId()) == true) { userAlerts.Add(eve.createAlert(e.getEventId(), 3)); numOfAlerts++; } } return numOfAlerts; }
private void facilitateEventBtn_Click(object sender, EventArgs e) { Facilitator potentialFacilitator = new Facilitator(currentUser); EventEntity facilitatingEvent = EventEntity.getEventFromEventId(currentEventID); if (Facilitator_Signup_Dialog(facilitatingEvent.getEventName())) { potentialFacilitator.joinEvent(currentEventID); } //Highlight change in state state = determineState(currentEventID); displayAppropriateBtn(state); }
private void displayParticipantList() { //Clear List attendanceListView.Items.Clear(); //Change Label label1.Text = "Participant List"; List<Participant> listofParticipant = new List<Participant>(); EventEntity newEve = EventEntity.getEventFromEventId(currentEventID); Facilitator fac = new Facilitator(currentUser); listofParticipant = fac.viewParticipantList(newEve); if (listofParticipant.Count != 0) { for (int i = 0; i < listofParticipant.Count; i++) { ListViewItem newParticipant = new ListViewItem((i + 1).ToString()); newParticipant.SubItems.Add(listofParticipant[i].getName().ToString()); newParticipant.SubItems.Add(listofParticipant[i].getEmail().ToString()); newParticipant.SubItems.Add(listofParticipant[i].getContactHP().ToString()); attendanceListView.Items.Add(newParticipant); } } else { ListViewItem newParticipant = new ListViewItem("No Participants"); } attendanceListView.Show(); }