MinorConditionDAL.cs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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.MinorManage.MinorSetting;
  7. using System.Linq.Expressions;
  8. using EMIS.Entities;
  9. using EMIS.ViewModel.ScoreManage;
  10. namespace EMIS.DataLogic.MinorManage.MinorSetting
  11. {
  12. public class MinorConditionDAL
  13. {
  14. public MinorConditionRepository minorConditionRepository { get; set; }
  15. public FinallyScoreRepository finallyScoreRepository { get; set; }
  16. public IQueryable<MinorConditionView> GetMinorConditionViewQueryable(Expression<Func<ER_MinorCondition, bool>> exp)
  17. {
  18. var query = from mcr in minorConditionRepository.GetList(exp)
  19. select new MinorConditionView
  20. {
  21. MinorConditionID = mcr.MinorConditionID,
  22. Title = mcr.Title,
  23. MethodFullName = mcr.MethodFullName,
  24. RecordStatus = mcr.RecordStatus,
  25. IsEnable = mcr.RecordStatus == 1 ? true : false,
  26. CreateUserID = mcr.CreateUserID,
  27. CreateTime = mcr.CreateTime,
  28. ModifyUserID = mcr.ModifyUserID,
  29. ModifyTime = mcr.ModifyTime
  30. };
  31. return query;
  32. }
  33. public IQueryable<StudentScoreView> GetAllScore(Guid userID)
  34. {
  35. var query = from a in finallyScoreRepository.GetList(x => x.UserID == userID)
  36. select new StudentScoreView
  37. {
  38. UserID = a.UserID,
  39. TotalScore = a.TotalScore,
  40. ExamsCategoryID = a.ExamsCategoryID
  41. };
  42. return query;
  43. }
  44. }
  45. }