コード例 #1
0
        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"));
            }
        }
コード例 #2
0
        // 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"));
            }
        }