public ActionResult SelectAllCoursesAssignedToDriver(string driverid) { try { IEnumerable <DriverLinkCourseModel> driverCourses = linkDriverCourseAdapter.SelectAllCoursesForOneDriver(driverid).OrderBy(x => x.Due_Date); PastDueCourseManager.ValidatePastDue(driverCourses); return(View("~/Views/Driver/DriverAssignedCourses.cshtml", driverCourses)); } catch { Log.Info($"Unable to find any courses for {driverid}"); return(View("~/Views/Error/SelectAllCoursesAssignedToDriverError.cshtml")); } }
// SELECT public ActionResult SelectAllAssignedCourses() { try { IEnumerable <DriverLinkCourseModel> boardOverview = linkDriverCourseAdapter.SelectAllCourses().OrderBy(x => x.Driver.DriverId); PastDueCourseManager.ValidatePastDue(boardOverview); return(View("~/Views/Admin/ViewAll/ViewAllAssignCourses.cshtml", boardOverview)); } catch { Log.Info($"Unable to find any courses in database"); return(View("~/Views/Error/SelectAllAssignedCoursesError.cshtml")); } }