SubjectCountLimitDAL.cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using EMIS.DataLogic.Repositories;
  6. using EMIS.ViewModel.ExaminationApply;
  7. using System.Linq.Expressions;
  8. using EMIS.Entities;
  9. namespace EMIS.DataLogic.ExaminationApply
  10. {
  11. public class SubjectCountLimitDAL
  12. {
  13. public ExaminationSubjectCountLimitRepository ExaminationSubjectCountLimitRepository { get; set; }
  14. public IQueryable<SubjectCountLimitView> GetSubjectCountLimitView(Expression<Func<EX_ExaminationSubjectCountLimit, bool>> subjectCountLimitExpression)
  15. {
  16. var q = (from es in ExaminationSubjectCountLimitRepository.GetList(subjectCountLimitExpression)
  17. select new SubjectCountLimitView
  18. {
  19. ExaminationSubjectCountLimitID = es.ExaminationSubjectCountLimitID,
  20. ExaminationTypeID = es.ExaminationTypeID,
  21. ExaminationTypeName = es.EX_ExaminationType.Name,
  22. FacultymajorID = es.FacultymajorID,
  23. FacultymajorName = es.CF_Facultymajor.Name,
  24. CollegeID=es.CF_Facultymajor.CollegeID,
  25. Years = es.Years,
  26. SubjectCountLimit = es.SubjectCountLimit,
  27. RecordStatus = es.RecordStatus,
  28. CreateUserID = es.CreateUserID,
  29. CreateTime = es.CreateTime,
  30. ModifyUserID = es.ModifyUserID,
  31. ModifyTime = es.ModifyTime//,
  32. }).OrderBy(x => x.ExaminationTypeName).ThenBy(x => x.FacultymajorName).ThenByDescending(x => x.Years);
  33. return q;
  34. }
  35. }
  36. }