TimeSegmentDAL.cs 1.0 KB

12345678910111213141516171819202122232425262728293031
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Linq.Expressions;
  6. using EMIS.Entities;
  7. using EMIS.ViewModel.ExaminationManage;
  8. using EMIS.DataLogic.Repositories;
  9. namespace EMIS.DataLogic.ExaminationManage
  10. {
  11. public class TimeSegmentDAL
  12. {
  13. public TimeSegmentRepository TimeSegmentRepository { get; set; }
  14. public IQueryable<TimeSegmentView> GetTimeSegmentView(Expression<Func<EX_TimeSegment, bool>> exp)
  15. {
  16. var query = (from ts in TimeSegmentRepository.GetList(exp)
  17. select new TimeSegmentView
  18. {
  19. TimeSegmentID = ts.TimeSegmentID,
  20. IsForResit = ts.IsForResit == true,
  21. ExaminationDate = ts.ExaminationDate.Value,
  22. StartTime = ts.StartTime.Value,
  23. EndTime = ts.EndTime.Value
  24. });
  25. return query;
  26. }
  27. }
  28. }