public JsonResult GetApproveLessons(DtoApproveLessonSearch search)
        {
            LessonBll bll = new LessonBll();
            List <DtoLessonApprove> list = bll.GetLessonApproveByPage(search);

            return(Json(AbhsTableFactory.Create(list, search.Pagination.TotalCount)));
        }
Beispiel #2
0
        /// <summary>
        /// 根据查询条件获取审批分页数据
        /// </summary>
        /// <param name="search"></param>
        /// <returns></returns>
        public IList <DtoLessonApprove> GetApproveLessonByPage(DtoApproveLessonSearch search)
        {
            Check.IfNull(search, nameof(search));
            string fields = @" course.Ycs_Id as [CourseID]
,course.Ycs_Name as [CourseName]
,course.Ycs_Grade as [Grade]
,course.Ycs_CourseType as [CourseType]
,lesson.Ycl_Id as [LessonID]
,lesson.Ycl_Index as [LessonIndex]
,lesson.Ycl_Name as [LessonName]
,lesson.Ycl_Producer as [LessonProducer]
,employee.Bem_Name as [LessonProducerName]
,lesson.Ycl_Status as [LessonStatus]
,lesson.Ycl_UpdateTime as [UpdateDate] ";
            string from   = $@" Yw_CourseLesson as lesson
inner join Yw_Course  as course on lesson.Ycl_CourseId = course.Ycs_Id
left join Bas_Employee as employee on lesson.Ycl_Producer = employee.Bem_Id
where (lesson.Ycl_Status = {(int)LessonStatusEnum.待审批} or lesson.Ycl_Status = {(int)LessonStatusEnum.审批中}) ";

            string where = from;
            if (search.CourseID != 0)
            {
                where += " and course.Ycs_Id=@courseId ";
            }
            if (search.CourseType != 0)
            {
                where += " and course.Ycs_CourseType = @courseType ";
            }
            if (search.Grade != 0)
            {
                where += " and course.Ycs_Grade = @grade ";
            }
            if (search.LessonIndex != 0)
            {
                where += " and lesson.Ycl_Index = @index  ";
            }
            if (!string.IsNullOrEmpty(search.LessonOrProducerName))
            {
                where += " and (lesson.Ycl_Name like @name or employee.Bem_Name like @name) ";
            }

            string orderby = " lesson.Ycl_UpdateTime desc ";
            object param   = new
            {
                courseId   = search.CourseID,
                courseType = search.CourseType,
                grade      = search.Grade,
                index      = search.LessonIndex,
                name       = $"{search.LessonOrProducerName}%"
            };

            return(base.QueryPaging <DtoLessonApprove>(
                       fields,
                       where,
                       orderby,
                       search.Pagination,
                       param).ToList());
        }
Beispiel #3
0
 /// <summary>
 /// 根据条件及分页信息查询审批过程中的课时信息
 /// </summary>
 /// <param name="search"></param>
 /// <returns></returns>
 public List <DtoLessonApprove> GetLessonApproveByPage(DtoApproveLessonSearch search)
 {
     return(LessonServer.GetApproveLessonByPage(search).ToList());
 }