123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Linq.Expressions;
- using EMIS.Entities;
- using EMIS.ViewModel;
- using EMIS.ViewModel.Cultureplan;
- using EMIS.DataLogic.Repositories;
- namespace EMIS.DataLogic.Common.Cultureplan
- {
- public class CoursematerialDAL
- {
- public CoursematerialRepository CoursematerialRepository { get; set; }
- public ClassGroupingRepository ClassGroupingRepository { get; set; }
- /// <summary>
- /// 查询对应的课程信息CoursematerialView
- /// </summary>
- /// <param name="exp"></param>
- /// <returns></returns>
- public IQueryable<CoursematerialView> GetCoursematerialViewQueryable(Expression<Func<EM_Coursematerial, bool>> exp)
- {
- var query = from cou in CoursematerialRepository.GetList(exp)
- join cg in ClassGroupingRepository.Entities
- on cou.ClassGroupingID equals cg.ClassGroupingID into tempcg
- from coucg in tempcg.DefaultIfEmpty()
- select new CoursematerialView
- {
- CoursematerialID = cou.CoursematerialID,
- CourseCode = cou.CourseCode,
- CourseName = cou.CourseName,
- Abbreviation = cou.Abbreviation,
- EnglishName = cou.EnglishName,
- StandardName = cou.StandardName,
- CourseEdition = cou.CourseEdition,
- CourseLevelID = cou.CourseLevelID,
- CourseScienceID = cou.CourseScienceID,
- ClassGroupingID = cou.ClassGroupingID,
- ClassName = coucg.ClassName,
- CourseSynopsis = cou.CourseSynopsis,
- CourseReserve = cou.CourseReserve,
- IsEnable = cou.IsEnable == true ? true : false,
- Remark = cou.Remark,
- RecordStatus = cou.RecordStatus,
- CreateUserID = cou.CreateUserID,
- CreateTime = cou.CreateTime,
- ModifyUserID = cou.ModifyUserID,
- ModifyTime = cou.ModifyTime
- };
- return query;
- }
- }
- }
|