Пример #1
0
        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.";
            }
        }
Пример #2
0
        private void editEventButton_Click(object sender, EventArgs e)
        {
            AddEventPage editEventPage = new AddEventPage(campNameLabel.Text, descriptionLabel.Text, Convert.ToDateTime(startDateLabel.Text), Convert.ToDateTime(endDateLabel.Text), Convert.ToDecimal(eventOrganizerManager.GetEventCampFees(eventId)));

            editEventPage.ShowDialog();

            if (editEventPage.isConfirm == true)
            {
                string   campName    = editEventPage.name;
                DateTime startDate   = editEventPage.startDate;
                DateTime endDate     = editEventPage.endDate;
                string   description = editEventPage.description;
                decimal  campFee     = editEventPage.campFee;

                eventOrganizerManager.EditEvents(campName, startDate, endDate, description, campFee, eventId);
                this.campNameLabel.Text    = campName;
                this.startDateLabel.Text   = startDate.ToString("d");
                this.endDateLabel.Text     = endDate.ToString("d");
                this.descriptionLabel.Text = description;
                toolStripStatusLabel1.Text = "The details for event <" + campNameLabel.Text + "> have been editted";
            }
        }
Пример #3
0
        private void editEventButton_Click(object sender, EventArgs e)
        {
            AddEventPage editEventPage = new AddEventPage(campNameLabel.Text, descriptionLabel.Text, Convert.ToDateTime(startDateLabel.Text), Convert.ToDateTime(endDateLabel.Text), Convert.ToDecimal(eventOrganizerManager.GetEventCampFees(eventId)));
            editEventPage.ShowDialog();

            if (editEventPage.isConfirm == true) {
                string campName = editEventPage.name;
                DateTime startDate = editEventPage.startDate;
                DateTime endDate = editEventPage.endDate;
                string description = editEventPage.description;
                decimal campFee = editEventPage.campFee;

                eventOrganizerManager.EditEvents(campName, startDate, endDate, description, campFee, eventId);
                this.campNameLabel.Text = campName;
                this.startDateLabel.Text = startDate.ToString("d");
                this.endDateLabel.Text = endDate.ToString("d");
                this.descriptionLabel.Text = description;
                toolStripStatusLabel1.Text = "The details for event <" + campNameLabel.Text + "> have been editted";
            }
        }
Пример #4
0
        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.";
            }
        }