123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- 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<CF_Schoolyear> GetSutdentSchoolyear(Expression<Func<CF_Student, bool>> 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;
- }
- /// <summary>
- /// 获取当前学校教学年
- /// </summary>
- /// <param name="stuExpression"></param>
- /// <returns></returns>
- public CF_Schoolyear GetCurSchoolyear()
- {
- var query = SchoolyearRepository.GetSingle(w=>w.IsCurrent);
- return query;
- }
- }
- }
|