Exemple #1
0
        public DashBoardPage(string matric, Server server)
        {
            InitializeComponent();
            this.server = server;
            this.matric = matric;
            studentEventManager = new StudentEventManager(server);

            this.nameLabel.Text = studentEventManager.GetName(matric);
            this.matricLabel.Text = matric;

            dateManager = new DateTimeManager();
            DateTime today = DateTime.Today;
            this.dateLabel.Text = today.ToString("d") + " |";
            this.weekLabel.Text = dateManager.CurrentAcademicWeek();
            this.academicYearSemLabel.Text = dateManager.CurrentAcademicYear();

            studentEventManager.GetStudentEventsTasks(this.myEventListView, this.myTaskListView, matric);
            studentEventManager.GetEvents(this.eventListView);
        }
Exemple #2
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.";
            }
        }
Exemple #3
0
        private void markAsUndoneButton_Click(object sender, EventArgs e)
        {
            StudentEventManager studentEventManager = new StudentEventManager(this.server);

            foreach(ListViewItem item in myTaskListView.SelectedItems) {
                int campID = Convert.ToInt32(item.SubItems[1].Text);
                int taskID = Convert.ToInt32(item.SubItems[3].Text);

                if (item.SubItems[4].Text == "Yes") {
                    item.SubItems[4].Text = "No";
                    studentEventManager.EditTaskStatus(campID, taskID, false);
                }

            }
            toolStripStatusLabel1.Text = "Selected task(s) have been marked undone.";
            dashBoardButtonDisable();
        }