StudentExaminationCourseDAL.cs 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using EMIS.ViewModel.ExaminationManage;
  6. using System.Linq.Expressions;
  7. using EMIS.Entities;
  8. using EMIS.DataLogic.Common.Students;
  9. using EMIS.DataLogic.Repositories;
  10. using EMIS.Utility.FormValidate;
  11. using Bowin.Common.Linq;
  12. namespace EMIS.DataLogic.ExaminationManage
  13. {
  14. public class StudentExaminationCourseDAL
  15. {
  16. public ExaminationPlanRepository ExaminationPlanRepository { get; set; }
  17. public ExaminationRoomLayoutRepository ExaminationRoomLayoutRepository { get; set; }
  18. public EducationMissionClassRepository EducationMissionClassRepository { get; set; }
  19. public EducationSchedulingClassRepository educationSchedulingClassRepository { get; set; }
  20. public EducationSchedulingRepository educationSchedulingRepository { get; set; }
  21. public ExaminationRoomStudentRepository examinationRoomStudentRepository { get; set; }
  22. public EducationSchedulingWeekNumRepository educationSchedulingWeekNumRepository { get; set; }
  23. public EducationMissionRepository EducationMissionRepository { get; set; }
  24. public StudentsDAL StudentsDAL { get; set; }
  25. public IQueryable<StudentExaminationCourseView> GetExaminationPlanView(Expression<Func<EX_ExaminationPlan, bool>> examinationPlanExpression,
  26. Guid userID)
  27. {
  28. //examinationPlanExpression = examinationPlanExpression.And(x =)
  29. //var inschool = StudentsDAL.InSchoolSettingRepository.Entities.Where(x => x.IsSelected == true).Select(x => x.InSchoolStatusID).ToList();
  30. var q = from ersr in examinationRoomStudentRepository.GetList(x => x.UserID == userID)
  31. join erlr in ExaminationRoomLayoutRepository.Entities
  32. on ersr.ExaminationRoomLayoutID equals erlr.ExaminationRoomLayoutID
  33. join ep in ExaminationPlanRepository.GetList(examinationPlanExpression)
  34. on erlr.ExaminationPlanID equals ep.ExaminationPlanID
  35. select new StudentExaminationCourseView
  36. {
  37. ExaminationPlanID = ep.ExaminationPlanID,
  38. SchoolyearID = ep.SchoolyearID,
  39. SchoolyearCode = ep.CF_Schoolyear.Code,
  40. CollegeID = ep.CollegeID,
  41. CollegeName = ep.CF_College.Name,
  42. CoursematerialID = ep.CoursematerialID,
  43. CoursematerialName = ep.EM_Coursematerial.CourseName,
  44. ExaminationModeID = ep.ExaminationModeID,
  45. ExaminationStyleID = ep.ExaminationStyleID,
  46. ClassroomNames = erlr.CF_Classroom.Name,
  47. ExamsCategoryID = ep.ExamsCategoryID,
  48. EducationMissionID = ep.EducationMissionID,
  49. ExaminationDate = ep.ExaminationDate,
  50. StartTime = ep.StartTime,
  51. EndTime = ep.EndTime,
  52. RecordStatus = ep.RecordStatus,
  53. CreateUserID = ep.CreateUserID,
  54. CreateTime = ep.CreateTime,
  55. ModifyUserID = ep.ModifyUserID,
  56. ModifyTime = ep.ModifyTime
  57. };
  58. return q;
  59. }
  60. }
  61. }