DegreeOpenControlDAL.cs 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Linq.Expressions;
  6. using EMIS.DataLogic.Repositories;
  7. using EMIS.ViewModel.DegreeManage.DegreeSetting;
  8. using EMIS.Entities;
  9. namespace EMIS.DataLogic.DegreeManage.DegreeSetting
  10. {
  11. public class DegreeOpenControlDAL
  12. {
  13. public DegreeOpenControlRepository DegreeOpenControlRepository { get; set; }
  14. public SchoolyearRepository SchoolyearRepository { get; set; }
  15. /// <summary>
  16. /// 查询对应的学位控制信息View
  17. /// </summary>
  18. /// <param name="exp"></param>
  19. /// <returns></returns>
  20. public IQueryable<DegreeOpenControlView> GetDegreeOpenControlViewQueryable(Expression<Func<ER_DegreeOpenControl, bool>> exp)
  21. {
  22. var query = from doc in DegreeOpenControlRepository.GetList(exp)
  23. join sy in SchoolyearRepository.Entities
  24. on doc.GraduatingSemesterID equals sy.SchoolyearID
  25. select new DegreeOpenControlView
  26. {
  27. DegreeOpenControlID = doc.DegreeOpenControlID,
  28. GraduatingSemesterID = doc.GraduatingSemesterID,
  29. GraduatingSemesterValue = sy.Value,
  30. GraduatingSemesterCode = sy.Code,
  31. DegreeBatchID = doc.DegreeBatchID,
  32. StartDate = doc.StartDate,
  33. EndDate = doc.EndDate,
  34. RecordStatus = doc.RecordStatus,
  35. CreateUserID = doc.CreateUserID,
  36. CreateTime = doc.CreateTime,
  37. ModifyUserID = doc.ModifyUserID,
  38. ModifyTime = doc.ModifyTime
  39. };
  40. return query;
  41. }
  42. }
  43. }