private void show_pnl_Activities()
        {
            // show panel and buttons
            pnl_DisplayData.Show();
            btnRefreshActivity.Show();

            // only accesible when logged in as admin
            if (role == "admin")
            {
                btnModifyActivities.Show();
            }

            try
            {
                SomerenLogic.Activity_Service activity_Service = new SomerenLogic.Activity_Service();
                List <Activity> activities = activity_Service.GetActivities();

                // clear the DataGridView and fill the column names
                ClearDataGridView();
                generateGridLayout(activities.FirstOrDefault().dataGridList());

                // Fill the DataGridView with all the drinks using a foreach
                foreach (var activity in activities)
                {
                    FillDataInGridView(activity.dataGrid(activity, aantalStudentenActiviteit(activity.id), aantalBegeleidersActiviteit(activity.id)));
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
        private void show_pnl_PlannedActivities()
        {
            // show panel and buttons
            pnl_DisplayData.Show();
            btnRefreshRooster.Show();

            // only accesible when logged in as admin
            if (role == "admin")
            {
                btnModifyRooster.Show();
            }

            try
            {
                SomerenLogic.Activity_Service activity_Service = new SomerenLogic.Activity_Service();
                List <ActivityForeignGroup>   list             = activity_Service.GetActivityForiegnGroup();

                // clear the DataGridView and fill the column names
                ClearDataGridView();
                generateGridLayout(list.FirstOrDefault().dataGridList());

                // Fill the DataGridView with all the drinks using a foreach
                foreach (var s in list)
                {
                    FillDataInGridView(s.dataGrid(s));
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Example #3
0
        private void btn_SwitchActivity_Click(object sender, EventArgs e)
        {
            SomerenLogic.Activity_Service activityService = new SomerenLogic.Activity_Service();
            List <Activity> activityList = activityService.GetActivities();


            string selectedItem = dgv_Schedule.CurrentCell.Value.ToString();

            Console.WriteLine(selectedItem);

            foreach (Activity a in activityList)
            {
                if (a.Omschijving == selectedItem)
                {
                    if (a.Day == "monday")
                    {
                        activityService.ChangeActivity("tuesday", selectedItem);
                        ShowMonday();
                    }
                    if (a.Day == "tuesday")
                    {
                        activityService.ChangeActivity("monday", selectedItem);
                        ShowTuesday();
                    }
                }
            }
        }
Example #4
0
        public void ShowEmptyList()
        {
            SomerenLogic.Activity_Service activityService = new SomerenLogic.Activity_Service();
            List <Activity> emptyList = activityService.EmptyActivity();

            dgv_Schedule.DataSource = emptyList;
            dgv_Schedule.Columns.RemoveAt(0);
            dgv_Schedule.Columns.RemoveAt(3);
        }
Example #5
0
        private void btn_Act_Add_Click(object sender, EventArgs e)
        {
            currentActivity.Description   = textBox_Act_Name.Text;
            currentActivity.Id            = int.Parse(textBox_Act_ID.Text);
            currentActivity.countMentors  = int.Parse(textBox_Act_Mentors.Text);
            currentActivity.countStudents = int.Parse(textBox_Act_Students.Text);

            SomerenLogic.Activity_Service actService = new SomerenLogic.Activity_Service();
            actService.AddActivity(currentActivity);
            this.Close();
        }
Example #6
0
        public void ShowTuesday()
        {
            SomerenLogic.Activity_Service activityService = new SomerenLogic.Activity_Service();
            List <Activity> activityList = activityService.GetActivities();


            List <Activity> dailyList = activityService.GetDayActivity("tuesday");

            dgv_Schedule.DataSource = dailyList;
            dgv_Schedule.Columns.RemoveAt(0);
            dgv_Schedule.Columns.RemoveAt(3);
        }
Example #7
0
        private void btnAddActivityconfirm_Click(object sender, EventArgs e)
        {
            SomerenLogic.Activity_Service activityService = new SomerenLogic.Activity_Service();

            int    ActivityId                = int.Parse(txt_AddActivityId.Text);
            string ActivityOmschrijving      = txt_AddActivityName.Text;
            int    ActivityAantalStudenten   = int.Parse(txt_AddActivityaantalstudenten.Text);
            int    ActivityAantalBegeleiders = int.Parse(txt_AddActivityAantalbegeleiders.Text);

            activityService.AddActivity(ActivityId, ActivityOmschrijving, ActivityAantalStudenten, ActivityAantalBegeleiders);

            pnl_AddActivity.Hide();
            listViewActivities.Refresh();
            listViewActivities.Items.Clear();
            ShowActivities();
        }
Example #8
0
        public List <ActivityFromTeacher> Change_Activities(int docentNumber, int VerangendeDocentIndex)
        {
            List <ActivityFromTeacher> Activiteiten_PersoonA   = new List <ActivityFromTeacher>();
            List <ActivityFromTeacher> Activiteiten_PersoonB   = new List <ActivityFromTeacher>();
            List <ActivityFromTeacher> Activiteiten_PersoonNew = new List <ActivityFromTeacher>();

            SomerenLogic.Activity_Service activiteitServiceA = new SomerenLogic.Activity_Service();
            Activiteiten_PersoonA = activiteitServiceA.Get_Teacher_SuperVisorId(docentNumber);

            SomerenLogic.Activity_Service activiteitServiceB = new SomerenLogic.Activity_Service();
            Activiteiten_PersoonB = activiteitServiceB.Get_Teacher_SuperVisorId(VerangendeDocentIndex);

            ActivityFromTeacher CopyPersoon_A = new ActivityFromTeacher();

            foreach (SomerenModel.ActivityFromTeacher a in Activiteiten_PersoonA)
            {
                ActivityFromTeacher li_A = new ActivityFromTeacher();
                li_A.LecturerId  = a.LecturerId;
                li_A.Description = a.Description;

                CopyPersoon_A.LecturerId  = a.LecturerId;
                CopyPersoon_A.Description = a.Description;

                a.Description = "";
            }

            foreach (SomerenModel.ActivityFromTeacher b in Activiteiten_PersoonB)
            {
                ActivityFromTeacher li_B = new ActivityFromTeacher();
                li_B.LecturerId  = b.LecturerId;
                li_B.Description = b.Description;

                ActivityFromTeacher TeacherBActivity2 = new ActivityFromTeacher();
                TeacherBActivity2.LecturerId  = b.LecturerId;
                TeacherBActivity2.Description = CopyPersoon_A.Description;

                ActivityFromTeacher li_B2 = new ActivityFromTeacher();
                li_B2.LecturerId  = b.LecturerId;
                li_B2.Description = CopyPersoon_A.Description;


                Activiteiten_PersoonNew.Add(li_B);
                Activiteiten_PersoonNew.Add(li_B2);
            }

            return(Activiteiten_PersoonNew);
        }
Example #9
0
        public void ShowActivities()
        {
            SomerenLogic.Activity_Service activityService = new SomerenLogic.Activity_Service();
            List <Activity> activityList = activityService.GetActivities();

            foreach (Activity a in activityList)
            {
                ListViewItem li = new ListViewItem();

                li.SubItems.Add(a.Id.ToString());
                li.Text = a.Omschijving;
                li.SubItems.Add(a.aantalStudenten.ToString());
                li.SubItems.Add(a.aantalBegeleiders.ToString());

                listViewActivities.Items.Add(li);
            }
        }
Example #10
0
 private int aantalBegeleidersActiviteit(int activityId)
 {
     // get the amount of mentors per activity
     SomerenLogic.Activity_Service activity_Service = new SomerenLogic.Activity_Service();
     return(activity_Service.getAantalBegeleiders(activityId));
 }
Example #11
0
 private int aantalStudentenActiviteit(int activityId)
 {
     // get the amount of students that participate in this activity
     SomerenLogic.Activity_Service activity_Service = new SomerenLogic.Activity_Service();
     return(activity_Service.getAantalStudenten(activityId));
 }