public CoursesForm(Course data = null)
        {
            InitializeComponent();
            _courseRepo = new CourseRepo();
            DropdownControls.BindDepartments(ref drpdownDept);

            if (data != null)
            {
                lblId.Text = data.Id.ToString();
                txtCourseTitle.Text = data.CourseTitle;
                txtCourseCode.Text = data.CourseCode;
                drpdownDept.SelectedValue = data.DepartmentId;
                drpdownDept.Enabled = false;
                lblTitle.Text = "Update Course";
            }
        }
 public CoursesList()
 {
     InitializeComponent();
     _courseRepo = new CourseRepo();
     DropdownControls.BindDepartments(ref drpdownDept, true);
 }