ExamProjectControlDAL.cs 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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 ExamProjectControlDAL
  11. {
  12. public ExaminationBatchProjectControlRepository ProjectControlRepository { get; set; }
  13. public ExaminationBatchProjectRepository BatchProjectRepository { get; set; }
  14. public DictionaryItemRepository DictionaryItemRepository { get; set; }
  15. public ExaminationTypeRepository TypeRepository { get; set; }
  16. public IQueryable<EMIS.ViewModel.ExamProjectControlView> GetList(Expression<Func<EX_ExaminationBatchProjectControl, bool>> expCampus)
  17. {
  18. var query = from a in ProjectControlRepository.GetList(expCampus)
  19. join b in BatchProjectRepository.Entities on a.ExaminationBatchProjectID equals b.ExaminationBatchProjectID
  20. select new EMIS.ViewModel.ExamProjectControlView
  21. {
  22. Schoolyear = b.EX_ExaminationBatch.CF_Schoolyear.Code,
  23. SchoolYearCode = b.EX_ExaminationBatch.CF_Schoolyear.SchoolyearID,
  24. ProjectName = b.EX_ExaminationProject.Name,
  25. StandardID = a.StandardID,
  26. SchoolyearNumID = a.SchoolyearID,
  27. ExaminationType = b.EX_ExaminationProject.EX_ExaminationType.Name,
  28. IsOnlinePay = a.IsOnlinePay,
  29. CollegeName = a.CF_College.Name,
  30. ExaminationBatchProject = a.EX_ExaminationBatchProject.EX_ExaminationBatch.Name,
  31. ExaminationProjectFee = a.EX_ExaminationProjectFee.Name,
  32. ExaminationBatchProjectID = a.ExaminationBatchProjectID,
  33. CollegeID = a.CollegeID,
  34. SchoolyearID = a.SchoolyearID,
  35. ExaminationBatchID = b.ExaminationBatchID,
  36. ExaminationProjectID = b.ExaminationProjectID,
  37. ExaminationProjectFeeID = a.ExaminationProjectFeeID,
  38. ExaminationBatchProjectControlID = a.ExaminationBatchProjectControlID,
  39. IsOnlinePayName = (a.IsOnlinePay == true ? "是" : "否"),
  40. ExaminationTypeID = b.EX_ExaminationProject.ExaminationTypeID,
  41. Name = b.EX_ExaminationProject.Name,
  42. };
  43. return query;
  44. }
  45. }
  46. }