Ejemplo n.º 1
0
        /// <summary>
        /// 根据条件获取学生的课程分页数据
        /// </summary>
        /// <param name="search"></param>
        /// <returns></returns>
        public List <DtoStudentCourseInfo> GetByStudentCourseSearch(DtoStudentCourseSearch search)
        {
            string fields = @" c.Ycs_CourseType  as [CourseType]
 ,cp.Yps_CourseId as [CourseID]
 ,c.Ycs_Name as [CourseName]
 ,c.Ycs_LessonCount as [LessonsNum]
 ,cp.Yps_LessonFinishedCount as [LessonsFinishedNum] 
 ,cp.Yps_NextLessonIndex as [NextLessonNum]
 ,cp.Yps_StartStudyTime as [CourseStartTime]
 ,cp.Yps_IsFinished as [CourseFinshed] 
 ,c.Ycs_Grade as [Grade]
 ,cp.Yps_SchoolId as [SchoolID]
 --,s.Bsl_SchoolName as [SchoolName]
 ,cp.Yps_ClassId as [ClassID]
 ,sc.Ycc_Name as [ClassName]
 ,sc.Ycc_ClassMaster as [TeacherID]
 ,st.Yoh_Name as [TeacherName]
 ,st.Yoh_Avatar as [TeacherImg] ";

            string where = @"Yw_StudentCourseProgress as cp
 left join Yw_Course as c on cp.Yps_CourseId = c.Ycs_Id 
 --left join Bas_School as s on cp.Yps_SchoolId = s.Bsl_Id
 left join Yw_SchoolClass as sc on cp.Yps_ClassId = sc.Ycc_Id
 left join Yw_SchoolTeacher as st on sc.Ycc_ClassMaster = st.Yoh_Id
where cp.yps_studentId = @StudentId and cp.Yps_IsFinished = @IsFinished and cp.Yps_Status=1";
            string orderby = " cp.Yps_CreateTime desc";

            return(QueryPaging <DtoStudentCourseInfo>(fields, where, orderby, search.Pagination, new { StudentId = search.StudentId, IsFinished = search.IsFinished }).ToList());
        }
 public void TestMethod2()
 {
     DtoStudentCourseSearch search = new DtoStudentCourseSearch()
     {
         IsFinished = false,
         Pagination = new Code.Common.PagingObject()
         {
             PageIndex  = 1,
             PageSize   = 10,
             TotalCount = 0
         },
         StudentId = 10000
     };
     StudentStudyBll bll  = new StudentStudyBll();
     var             data = bll.GetCourseProgressByStudentSearch(search);
     string          json = JsonConvert.SerializeObject(data);
 }
        public JsonResult GetCourseByPage(DtoStudentCourseSearch search)
        {
            search.StudentId = GetCurrentUser().StudentId;
            StudentStudyBll bll  = new StudentStudyBll();
            var             list = bll.GetCourseProgressByStudentSearch(search);

            list.ForEach(s =>
            {
                s.TeacherImg = ConfigurationManager.AppSettings["OssHostUrl"] + s.TeacherImg;
            });
            return(Json(new JsonResponse <object>
            {
                State = true,
                ErrorCode = 0,
                ErrorMsg = "",
                Data = new { totel = search.Pagination.TotalCount, list = list }
            }));
        }
Ejemplo n.º 4
0
 /// <summary>
 /// 根据学生分页条件获取学生课程信息
 /// </summary>
 /// <param name="search"></param>
 /// <returns></returns>
 public List <DtoStudentCourseInfo> GetCourseProgressByStudentSearch(DtoStudentCourseSearch search)
 {
     return(ScpRepository.GetByStudentCourseSearch(search));
 }