public Form_AddConstraint(User u)
        {
            InitializeComponent();
            dal = new DbContextDal();

            //Receives a staff member indicating what authorization is, to know what actions are allowed
            user = u;
            if (user != null)
            {
                if (user.permission.Equals("Lecturer"))
                {
                    lecturer            = dal.lecturers.Find(user.ID);
                    listApprovedCourses = lecturer.getAllMyCourseInStateApproved();
                }
                else if (user.permission.Equals("Practitioner"))
                {
                    practitioner        = dal.practitiners.Find(user.ID);
                    listApprovedCourses = practitioner.getAllMyCourseInStateApproved();
                }
                else
                {
                    MessageBox.Show("Error: Could not identify user details! (Only Lecturer / Practitioner can enter to here)");
                    clickGoBack = true;
                    Close();
                }
            }
            else
            {
                MessageBox.Show("Error: Could not identify user details!");
                clickGoBack = true;
                Close();
            }

            if (listApprovedCourses != null)
            {
                string[] CB_coursesItems = new string[listApprovedCourses.Count + 1];
                CB_coursesItems[0] = "";
                for (int i = 0; i < listApprovedCourses.Count; i++)
                {
                    string str = listApprovedCourses.ElementAt(i).ID.ToString() + " : " + listApprovedCourses.ElementAt(i).Name;
                    CB_coursesItems[i + 1] = str;
                }

                txt_CB_coursesApproved.DataSource = CB_coursesItems;
            }

            txt_checkBox_allCourses.Checked = true;
            updateButtonsAndTextBoxes();
            GeneralFuntion.BlockResizeListViewColumns(listView_constraints);
            GeneralFuntion.Form_Center_FixedDialog(this);
        }
        private void setApprovedCoursesOfPractitioner(Practitioner p)
        {
            list_ApprovedCourses = p.getAllMyCourseInStateApproved();

            if (list_ApprovedCourses != null)
            {
                string[] CB_CourseItems = new string[list_ApprovedCourses.Count + 1];
                CB_CourseItems[0] = "";
                for (int i = 0; i < list_ApprovedCourses.Count; i++)
                {
                    string str = list_ApprovedCourses.ElementAt(i).ID.ToString() + " : " + list_ApprovedCourses.ElementAt(i).Name;
                    CB_CourseItems[i + 1] = str;
                }

                txt_CB_coursesApproved.DataSource = CB_CourseItems;
            }
        }