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(); }
private void createEvent() { dashBoardButtonDisable(); StudentEventManager studentEventManager = new StudentEventManager(this.server); AddEventPage addPage = new AddEventPage(); addPage.ShowDialog(); if (addPage.isConfirm == true) { string campName = addPage.name; DateTime startDate = addPage.startDate; DateTime endDate = addPage.endDate; string description = addPage.description; decimal campFee = addPage.campFee; int campID = studentEventManager.AddEvents(campName, startDate, endDate, description, campFee); // add list view ListViewItem newEvent = new ListViewItem(new[] { campName, "Organiser", campID.ToString() }); myEventListView.Items.Add(newEvent); // use student to add this event // set this student as organiser for this event Student student = server.GetStudent(this.matric); student.AddEvents(this.server, campID, 1); addPage.Close(); 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); toolStripStatusLabel1.Text = "You have added <" + campName + "> to My Events."; } }
private void createEvent() { dashBoardButtonDisable(); StudentEventManager studentEventManager = new StudentEventManager(this.server); AddEventPage addPage = new AddEventPage(); addPage.ShowDialog(); if (addPage.isConfirm == true) { string campName = addPage.name; DateTime startDate = addPage.startDate; DateTime endDate = addPage.endDate; string description = addPage.description; decimal campFee = addPage.campFee; int campID = studentEventManager.AddEvents(campName, startDate, endDate, description, campFee); // add list view ListViewItem newEvent = new ListViewItem(new[] { campName, "Organiser", campID.ToString() }); myEventListView.Items.Add(newEvent); // use student to add this event // set this student as organiser for this event Student student = server.GetStudent(this.matric); student.AddEvents(this.server, campID, 1); addPage.Close(); 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); toolStripStatusLabel1.Text = "You have added <" + campName + "> to My Events."; } }
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(); }