LevelSettingDAL.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. using System;
  2. using System.Collections.Generic;
  3. using EMIS.DataLogic.Repositories;
  4. using System.Linq;
  5. using System.Text;
  6. using EMIS.ViewModel.ScoreManage;
  7. using EMIS.Entities;
  8. using System.Linq.Expressions;
  9. namespace EMIS.DataLogic.ScoreManage
  10. {
  11. public class LevelSettingDAL
  12. {
  13. public LevelSettingRepository levelSettingRepository { get; set; }
  14. public ExaminationSubjectRepository examinationSubjectRepository { get; set; }
  15. public IQueryable<LevelSettingView> GetLevelSettingViewQueryable(Expression<Func<ER_LevelSetting, bool>> exp)
  16. {
  17. var query = from a in levelSettingRepository.GetList(exp)
  18. join b in examinationSubjectRepository.Entities on a.ExaminationSubjectID equals b.ExaminationSubjectID
  19. select new LevelSettingView
  20. {
  21. LevelSettingID = a.LevelSettingID,
  22. ExaminationSubjectID = a.ExaminationSubjectID,
  23. ExaminationSubjectName = b.Name,
  24. LevelNo = a.LevelNum.Value,
  25. LevelName = a.LevelName,
  26. MaxScore = a.MaxScore.Value,
  27. MinScore = a.MinScore.Value,
  28. ScoreRange = a.MinScore.ToString() + " <=总成绩<= " + a.MaxScore.ToString(),
  29. Remark = a.Remark
  30. };
  31. return query;
  32. }
  33. }
  34. }