TeacherEvaluationDAL.cs 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. using EMIS.ViewModel.EvaluationManage;
  9. using EMIS.DataLogic.SystemDAL;
  10. using EMIS.ViewModel;
  11. using EMIS.ViewModel.UniversityManage.TeacherManage;
  12. namespace EMIS.DataLogic.Common.EvaluationManage
  13. {
  14. public class TeacherEvaluationDAL
  15. {
  16. public TeacherEvaluationRepository TeacherEvaluationRepository { get; set; }
  17. public DictionaryDAL DictionaryDAL { get; set; }
  18. //public SpecialtyPlanRepository SpecialtyPlanRepository { get; set; } //专业计划
  19. public EducationMissionClassRepository EducationMissionClassRepository { get; set; }
  20. public IQueryable<TeacherEvaluationView> GetTeacherEvaluationQuery(Expression<Func<EM_TeacherEvaluation, bool>> filter)
  21. {
  22. var query = from c in TeacherEvaluationRepository.GetList(filter)
  23. join d in DictionaryDAL.GetDictionaryItemQuery(typeof(CF_YesOrNoStatus).Name) on c.OpenStatus equals d.Value
  24. join emc in EducationMissionClassRepository.Entities on c.EducationMissionClassID equals emc.EducationMissionClassID
  25. select new TeacherEvaluationView
  26. {
  27. EntityID = c.ID,
  28. EntityCode = c.Code,
  29. OpenStatus = c.OpenStatus,
  30. OpenStatusName = d.Name,
  31. Remark = c.Remark,
  32. TableID = c.TableID,
  33. EvaluationTypeName = c.EM_EvaluationTable.EM_EvaluationType.Name,
  34. EvaluationTableName = c.EM_EvaluationTable.Name,
  35. EvaluationTableNo = c.EM_EvaluationTable.Code,
  36. EducationMissionClassID = c.EducationMissionClassID,
  37. EducationMissionClassName = c.EM_EducationMissionClass.Name,
  38. SchoolyearID = emc.EM_EducationMission.CF_Schoolyear.SchoolyearID,
  39. SchoolyearCode = emc.EM_EducationMission.CF_Schoolyear.Code,
  40. CourseName = emc.EM_Coursematerial.CourseName,
  41. CourseCode = emc.EM_Coursematerial.CourseCode,
  42. Sys_User = c.EM_EducationMissionClass.EM_MissionClassTeacher.Select(s => s.CF_Staff.Sys_User),
  43. DepartmentID = emc.EM_EducationMission.CF_Department.DepartmentID,
  44. CollegeID = emc.EM_EducationMission.CF_Department.CF_College.CollegeID,
  45. CampusID = emc.EM_EducationMission.CF_Department.CF_College.CampusID,
  46. EntityCreateTime = c.CreateTime,
  47. Participators = c.CF_Staff.Select(s => new ParticipatorView { Code = s.StaffCode, Name = s.Sys_User.Name }),
  48. };
  49. return query;
  50. }
  51. }
  52. }