示例#1
0
        private void viewEventButton_Click(object sender, EventArgs e)
        {
            ListViewItem campEvent = myEventListView.SelectedItems[0];
            string roleInWords = campEvent.SubItems[1].Text;
            int role = 0;
            int campID = Convert.ToInt32(campEvent.SubItems[2].Text);;

            if (roleInWords == "Organiser") role = 1;
            if (roleInWords == "Facilitator") role = 2;
            if (roleInWords == "Participant") role = 3;

            if (role == 3 || role == 2) { // if participant or facilitator
                EventDetailsManager eventDetailsManager = new EventDetailsManager(this.server);

                string eventName = eventDetailsManager.GetEventName(campID);
                string eventStartDate = eventDetailsManager.GetEventStartDate(campID);
                string eventEndDate = eventDetailsManager.GetEventEndDate(campID);
                string eventDescription = eventDetailsManager.GetEventDescription(campID);

                SeeEventDetailsPage seeDetailsPage = new SeeEventDetailsPage(eventName, eventStartDate, eventEndDate, eventDescription, true);
                seeDetailsPage.ShowDialog();
            } else {
                EventControllerPage eventControllerPage = new EventControllerPage(this.server, campID, this.matric);
                this.Hide();
                eventControllerPage.ShowDialog();
                this.Show();
                myEventListView.Items.Clear();
                myTaskListView.Items.Clear();
                studentEventManager.GetStudentEventsTasks(this.myEventListView, this.myTaskListView, matric);
                eventListView.Items.Clear();
                studentEventManager.GetEvents(this.eventListView);
            }

            dashBoardButtonDisable();
        }
示例#2
0
        private void seeDetailsButton_Click(object sender, EventArgs e)
        {
            EventDetailsManager eventDetailsManager = new EventDetailsManager(this.server);
            SeeEventDetailsPage seeDetailsPage;
            ListViewItem campEvent = eventListView.SelectedItems[0];
            int campID = Convert.ToInt32(campEvent.SubItems[3].Text);

            string eventName = eventDetailsManager.GetEventName(campID);
            string eventStartDate = eventDetailsManager.GetEventStartDate(campID);
            string eventEndDate = eventDetailsManager.GetEventEndDate(campID);
            string eventDescription = eventDetailsManager.GetEventDescription(campID);

            // check if student is already inside the event
            Event selectedEvent = server.GetEvent(campID);
            if (selectedEvent.SearchStudent(matric, 1) || selectedEvent.SearchStudent(matric, 2) || selectedEvent.SearchStudent(matric, 3)) {
                seeDetailsPage = new SeeEventDetailsPage(eventName, eventStartDate, eventStartDate, eventDescription, true);
                seeDetailsPage.ShowDialog();
            } else {
                seeDetailsPage = new SeeEventDetailsPage(eventName, eventStartDate, eventEndDate, eventDescription);
                seeDetailsPage.ShowDialog();
                if (seeDetailsPage.isJoin == true) {
                    eventDetailsManager.StudentJoinEvent(this.matric, campID, seeDetailsPage.role);
                    seeDetailsPage.Close();
                }
            }
            myEventListView.Items.Clear();
            myTaskListView.Items.Clear();
            studentEventManager.GetStudentEventsTasks(this.myEventListView, this.myTaskListView, matric);
            dashBoardButtonDisable();
        }