LevelStandardDAL.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233
  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.PaymentManage;
  8. using EMIS.Entities;
  9. namespace EMIS.DataLogic.PaymentManage
  10. {
  11. public class LevelStandardDAL
  12. {
  13. public LevelStandardRepository LevelStandardRepository { get; set; }
  14. public TeacherTypeSettingRepository TeacherTypeSettingRepository { get; set; }
  15. public IQueryable<LevelStandardView> GetLevelStandardViewQueryable(Expression<Func<TP_LevelStandard, bool>> exp)
  16. {
  17. var query = from standard in LevelStandardRepository.GetList(exp)
  18. join setting in TeacherTypeSettingRepository.Entities on standard.TeacherType equals setting.TeacherTypeID into dsetting
  19. from setting in dsetting.DefaultIfEmpty()
  20. select new LevelStandardView
  21. {
  22. EmploymentTypeID = setting.EmploymentTypeID,
  23. LevelStandardID = standard.LevelStandardID,
  24. PaymentLevelID = standard.PaymentLevelID,
  25. TeacherType = standard.TeacherType,
  26. Amount = standard.Amount
  27. };
  28. return query;
  29. }
  30. }
  31. }