public ActionResult CreateCourse(CoursesViewModel courseViewModel)
 {
     this.logger.Info("Entering: " + System.Reflection.MethodBase.GetCurrentMethod().ReflectedType.FullName + ": " + System.Reflection.MethodBase.GetCurrentMethod().Name + " --> " + User.Identity.Name);
     try {
         Courses c = new Courses();
         c.CourdeCode = courseViewModel.CourdeCode;
         c.CourseName = courseViewModel.CourseName;
         c.NumberOfCredits = courseViewModel.NumberOfCredits;
         c.SyllabusId = courseViewModel.SyllabusId;
         this.courseManagement.Add(c);
         return RedirectToAction("DisplayCourses");
     }
     catch (CustomException ce) {
         this.logger.Trace(ce, "Username: "******"Operation could not be completed! Try again.";
         return View("Error");
     }
     catch (Exception ex) {
         this.logger.Trace(ex, "Username: "******"Operation could not be completed!";
         return View("Error");
     }
 }
        /// <summary>
        /// Gets the view model.
        /// </summary>
        /// <param name="course">The course.</param>
        /// <returns></returns>
        /// <exception cref="CustomException"></exception>
        public CoursesViewModel GetViewModel(Courses course)
        {
            try {
                CoursesViewModel cvm = new CoursesViewModel();
                cvm.CourdeCode = course.CourdeCode;
                cvm.CourseId = course.CourseId;
                cvm.CourseName = course.CourseName;
                cvm.NumberOfCredits = course.NumberOfCredits;
                cvm.SyllabusId = course.SyllabusId;

                return cvm;
            } catch (Exception ex) {
                throw new CustomException(ex.Message);
            }
        }