using System; using System.Collections.Generic; using System.Linq; using System.Text; using Bowin.Common.Linq; using EMISOnline.Entities; using EMISOnline.DataLogic.Repositories; using EMISOnline.ViewModel.SystemView; using System.Linq.Expressions; namespace EMISOnline.DataLogic.Student { public class SchoolyearDAL { public StudentRepository StudentRepository { get; set; } public SchoolyearRepository SchoolyearRepository { get; set; } public ExecutablePlanRepository ExecutablePlanRepository { get; set; } public ClassmajorRepository ClassmajorRepository { get; set; } public GrademajorRepository GrademajorRepository { get; set; } public IQueryable GetSutdentSchoolyear(Expression> stuExpression) { var query = from s in SchoolyearRepository.Entities join g in GrademajorRepository.Entities on s.Years equals g.SchoolyearID join c in ClassmajorRepository.Entities on g.GrademajorID equals c.GrademajorID join stu in StudentRepository.GetList(stuExpression) on c.ClassmajorID equals stu.ClassmajorID where s.SchoolcodeID == g.SchoolcodeID select s; return query; } /// /// 获取当前学校教学年 /// /// /// public CF_Schoolyear GetCurSchoolyear() { var query = SchoolyearRepository.GetSingle(w=>w.IsCurrent); return query; } } }