RetakeOpenControlDAL.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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.RetakeManage;
  7. using EMIS.ViewModel;
  8. using EMIS.Entities;
  9. using System.Linq.Expressions;
  10. namespace EMIS.DataLogic.RetakeManage
  11. {
  12. public class RetakeOpenControlDAL
  13. {
  14. public RetakeOpenControlRepository RetakeOpenControlRepository { get; set; }
  15. public SchoolyearRepository SchoolyearRepository { get; set; }
  16. /// <summary>
  17. /// 查询重修控制信息View
  18. /// </summary>
  19. /// <param name="exp"></param>
  20. /// <returns></returns>
  21. public IQueryable<RetakeOpenControlView> GetRetakeOpenControlViewQuery(Expression<Func<ER_RetakeOpenControl, bool>> exp)
  22. {
  23. var query = (from opencontrol in RetakeOpenControlRepository.GetList(exp)
  24. join schoolyear in SchoolyearRepository.Entities on opencontrol.SchoolyearID equals schoolyear.SchoolyearID
  25. select new RetakeOpenControlView
  26. {
  27. RetakeOpenControlID = opencontrol.RetakeOpenControlID,
  28. SchoolyearID = opencontrol.SchoolyearID,
  29. SchoolyearCode = schoolyear.Code,
  30. StartDate = opencontrol.StartDate,
  31. EndDate = opencontrol.EndDate
  32. });
  33. return query;
  34. }
  35. }
  36. }