ExamBatchProjectDAL.cs 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using EMIS.DataLogic.Repositories;
  6. using System.Linq.Expressions;
  7. using EMIS.Entities;
  8. namespace EMIS.DataLogic.ExamManage
  9. {
  10. public class ExamBatchProjectDAL
  11. {
  12. public ExaminationBatchProjectRepository BatchProjectRepository { get; set; }
  13. public ExaminationBatchRepository BatchRepository { get; set; }
  14. public IQueryable<EMIS.ViewModel.ExamBatchProjectView> GetBatchProjectList(Expression<Func<EX_ExaminationBatchProject, bool>> expCampus)
  15. {
  16. var query = from b in BatchProjectRepository.GetList(expCampus)
  17. join a in BatchRepository.Entities on b.ExaminationBatchID equals a.ExaminationBatchID
  18. select new EMIS.ViewModel.ExamBatchProjectView
  19. {
  20. Schoolyear = a.CF_Schoolyear.Code,
  21. SchoolYearCode = a.CF_Schoolyear.SchoolyearID,
  22. BatchName = b.EX_ExaminationBatch.Name,
  23. EndDate = b.EndDate,
  24. ExaminationBatchID = a.ExaminationBatchID,
  25. Name = b.EX_ExaminationProject.Name,
  26. Remark = b.Remark,
  27. SchoolyearID = a.SchoolyearID,
  28. StartDate = b.StartDate,
  29. ExaminationProjectID = b.ExaminationProjectID,
  30. MaxRegistCount = b.MaxRegistCount,
  31. SimulateTime = b.SimulateTime,
  32. TakeCourseTime = b.TakeCourseTime,
  33. Training = b.Training,
  34. ExaminationType = b.EX_ExaminationProject.EX_ExaminationType.Name,
  35. ExaminationBatchProjectID = b.ExaminationBatchProjectID,
  36. ExaminationTypeID = b.EX_ExaminationProject.ExaminationTypeID,
  37. RecordStatus = b.RecordStatus
  38. };
  39. return query;
  40. }
  41. }
  42. }