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 registerEventBtn_Click(object sender, EventArgs e) { Participant registeringParticipant = new Participant(currentUser); EventEntity registeringEvent = EventEntity.getEventFromEventId(currentEventID); if (Participant_Register_Dialog(registeringEvent.getEventName())) { registeringParticipant.registerEvent(registeringEvent); MessageBox.Show("You have successfully registered this event. Thank you.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); } //Highlight change in state state = determineState(currentEventID); displayAppropriateBtn(state); this.Close(); }
private void eventInfoForm_Load(object sender, EventArgs e) { EventEntity newEve = Facilitator.getEventEntity(currentEventID); titleLabel.Text = newEve.getEventName(); int organiserID = newEve.getOrganiserID(); organiserLabel.Text = User.getNamefromID(organiserID); noOfParticipantLabel.Text = EventEntity.getParticipantSize(currentEventID).ToString(); // Version 1 /* venueLabel.Text = EventEntity.getStartVenueFromEventID(currentEventID); Queue<DateTime> listOfDateTime = EventEntity.getListOfTimeFromEventID(currentEventID); Queue<string> listofDescription = EventEntity.getListOfDescriptionFromEventID(currentEventID); Queue<string> listOfVenue = EventEntity.getListOfVenueFromEventID(currentEventID); DateTime dateTimeValue = DateTime.Now; while (!(listOfDateTime.Count == 0)) { ListViewItem newevent = new ListViewItem(String.Format("{0:t}", listOfDateTime.Dequeue())); newevent.SubItems.Add(listofDescription.Dequeue()); newevent.SubItems.Add(listOfVenue.Dequeue()); scheduleEventView.Items.Add(newevent); } */ // Version 2 DateTime dateValue = EventEntity.getStartTime(currentEventID); dateLabel.Text = String.Format("{0:f}", dateValue); DateTime enddateValue = EventEntity.getEndTime(currentEventID); Queue<DateTime> listOfDateTime = EventEntity.getListOfTimeFromEventID(currentEventID); Queue<string> listofDescription = EventEntity.getListOfDescriptionFromEventID(currentEventID); Queue<string> listOfVenue = EventEntity.getListOfVenueFromEventID(currentEventID); // venueLabel.Text = EventEntity.getStartVenueFromEventID(currentEventID); setScheduleDay(dateValue, enddateValue); dateCombobox.Text = dateValue.ToLongDateString(); int venueFlag = 0; while (!(listOfDateTime.Count == 0)) { DateTime currDateTimeValue = listOfDateTime.Dequeue(); string currDescription = listofDescription.Dequeue(); string currVenue = listOfVenue.Dequeue(); if (currDateTimeValue.Year == dateValue.Year && currDateTimeValue.Month == dateValue.Month && currDateTimeValue.Day == dateValue.Day) { ListViewItem newevent = new ListViewItem(String.Format("{0:t}", currDateTimeValue)); newevent.SubItems.Add(currDescription); newevent.SubItems.Add(currVenue); scheduleEventView.Items.Add(newevent); } if (venueFlag == 0) { venueLabel.Text = currVenue; venueFlag++; } } //display the appropriate btn based on the states state = determineState(currentEventID); displayAppropriateBtn(state); }