public void OnGet() { var us = base.GetUserSession(); if (us != null) { CourseTimes = StaticDataSrv.CourseTime.Values.ToList(); //获取所有课程信息,并整理Day,Lesson Hashtable CourseScheduleList = _CourseSrv.GetCourseScheduleByYearType(DateTime.Now.Year, CourseScheduleType.Standard); } }
public IActionResult OnPostGet(int year, CourseScheduleType scheduleType) { ResultObject <PPlan> result = new ResultObject <PPlan>(); try { ECourseDateRange dr = StaticDataSrv.CourseDateRange.Where(a => a.CourseScheduleType == scheduleType && a.Year == year).FirstOrDefault(); result.Entity.PlanInfo = ""; if (dr != null) { result.Entity.PlanInfo = $"{dr.Year} {dr.CourseDateRangeName}: {dr.StartDate.ToString("MM月dd日")} 到 {dr.EndDate.ToString("MM月dd日")}"; } result.Entity.CourseScheduleList = _CourseSrv.GetCourseScheduleByYearType(year, scheduleType); } catch (Exception ex) { result.ErrorMsg = ex.Message; } return(new JsonResult(result)); }