EvaluationControlDAL.cs 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Linq.Expressions;
  5. using System.Text;
  6. using EMIS.Entities;
  7. using EMIS.ViewModel.EvaluationManage.EvaluationSetting;
  8. using EMIS.DataLogic.Repositories;
  9. namespace EMIS.DataLogic.EvaluationManage.EvaluationSetting
  10. {
  11. public class EvaluationControlDAL
  12. {
  13. public EvaluationControlRepository EvaluationControlRepository { get; set; }
  14. public SchoolyearRepository SchoolyearRepository { get; set; }
  15. public ControlItemRepository ControlItemRepository { get; set; }
  16. /// <summary>
  17. /// 查询对应的评价控制信息EvaluationControlView
  18. /// </summary>
  19. /// <param name="exp"></param>
  20. /// <returns></returns>
  21. public IQueryable<EvaluationControlView> GetEvaluationControlViewQueryable(Expression<Func<EM_EvaluationControl, bool>> exp)
  22. {
  23. var query = from evct in EvaluationControlRepository.GetList(exp)
  24. join sy in SchoolyearRepository.Entities
  25. on evct.SchoolyearID equals sy.SchoolyearID
  26. select new EvaluationControlView
  27. {
  28. EvaluationControlID = evct.EvaluationControlID,
  29. SchoolyearID = evct.SchoolyearID,
  30. SchoolyearValue = sy.Value,
  31. SchoolyearCode = sy.Code,
  32. IsSelectCourseLock = evct.IsSelectCourseLock.Value,
  33. IsExaminationApplyLock = evct.IsExaminationApplyLock.Value,
  34. IsCourseScoreLock = evct.IsCourseScoreLock.Value,
  35. IsLevelScoreLock = evct.IsLevelScoreLock.Value,
  36. NoNumber = evct.NoNumber ?? 0,
  37. RecordStatus = evct.RecordStatus,
  38. CreateUserID = evct.CreateUserID,
  39. CreateTime = evct.CreateTime,
  40. ModifyUserID = evct.ModifyUserID,
  41. ModifyTime = evct.ModifyTime
  42. };
  43. return query;
  44. }
  45. }
  46. }