WorktimeRateDAL.cs 1.6 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.PaymentManage;
  7. using System.Linq.Expressions;
  8. using EMIS.Entities;
  9. namespace EMIS.DataLogic.PaymentManage
  10. {
  11. public class WorktimeRateDAL
  12. {
  13. public CollegeRepository CollegeRepository { get; set; }
  14. public WorktimeRateRepository WorktimeRateRepository { get; set; }
  15. public IQueryable<WorktimeRateView> GetWorktimeRateViewQueryable(Expression<Func<TP_WorktimeRate, bool>> exp)
  16. {
  17. var sql = (from rate in WorktimeRateRepository.GetList(exp)
  18. join college in CollegeRepository.Entities on rate.CollegeID equals college.CollegeID into dcollege
  19. from college in dcollege.DefaultIfEmpty()
  20. select new WorktimeRateView
  21. {
  22. WorktimeRateID = rate.WorktimeRateID,
  23. CollegeID = rate.CollegeID,
  24. CollegeNo = college.No,
  25. CollegeName = college.Name,
  26. TeachingModeID = rate.TeachingModeID,
  27. TeachingMethodID = rate.TeachingMethodID,
  28. PaymentLevelID = rate.PaymentLevelID,
  29. StudentCountStart = rate.StudentCountStart,
  30. StudentCountEnd = rate.StudentCountEnd,
  31. WorktimeRate = rate.WorktimeRate
  32. });
  33. return sql;
  34. }
  35. }
  36. }