ExamPersonControlDAL.cs 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 ExamPersonControlDAL
  11. {
  12. public ExaminationBatchProjectPersonControlRepository PersonControlRepository { get; set; }
  13. public ExaminationBatchProjectRepository BatchProjectRepository { get; set; }
  14. public DictionaryItemRepository DictionaryItemRepository { get; set; }
  15. public ExaminationTypeRepository TypeRepository { get; set; }
  16. public StudentRepository StudentRepository { get; set; }
  17. public IQueryable<EMIS.ViewModel.ExamPersonControlView> GetList(Expression<Func<EX_ExaminationBatchProjectPersonControl, bool>> expCampus)
  18. {
  19. var query = from a in PersonControlRepository.GetList(expCampus)
  20. join b in BatchProjectRepository.Entities on a.ExaminationBatchProjectID equals b.ExaminationBatchProjectID
  21. join c in StudentRepository.Entities on a.UserID equals c.UserID
  22. select new EMIS.ViewModel.ExamPersonControlView
  23. {
  24. Schoolyear = b.EX_ExaminationBatch.CF_Schoolyear.Code,
  25. SchoolYearCode = b.EX_ExaminationBatch.CF_Schoolyear.SchoolyearID,
  26. ExaminationBatchID = b.ExaminationBatchID,
  27. ExaminationBatchProject = a.EX_ExaminationBatchProject.EX_ExaminationBatch.Name,
  28. ExaminationProjectFee = a.EX_ExaminationProjectFee.Name,
  29. StartDate = a.StartDate,
  30. ExaminationBatchProjectID = a.ExaminationBatchProjectID,
  31. ExaminationProjectFeeID = a.ExaminationProjectFeeID,
  32. IsOnlinePayName = (a.IsOnlinePay == true ? "是" : "否"),
  33. ExaminationTypeID = b.EX_ExaminationProject.ExaminationTypeID,
  34. EndDate = a.EndDate,
  35. ExaminationBatchProjectPersonControlID = a.ExaminationBatchProjectPersonControlID,
  36. IsOnlinePay = a.IsOnlinePay,
  37. UserID = a.UserID,
  38. ExaminationProjectID = b.ExaminationProjectID,
  39. ProjectName = b.EX_ExaminationProject.Name,
  40. ExaminationType = b.EX_ExaminationProject.EX_ExaminationType.Name,
  41. CollegeID = c.CF_Classmajor.CF_Grademajor.CF_Facultymajor.CollegeID,
  42. UserName = c.Sys_User.Name,
  43. Sex = c.Sex,
  44. IDNumber = c.IDNumber,
  45. ClassmajorName = c.CF_Classmajor.Name,
  46. ClassmajorID = c.ClassmajorID,
  47. GrademajorName = c.CF_Classmajor.CF_Grademajor.Name,
  48. CollegeName = c.CF_Classmajor.CF_Grademajor.CF_Facultymajor.CF_College.Name,
  49. Years = c.CF_Classmajor.CF_Grademajor.SchoolyearID.ToString(),
  50. StandardID = c.CF_Classmajor.CF_Grademajor.CF_Facultymajor.StandardID,
  51. };
  52. return query;
  53. }
  54. }
  55. }