EvaluationCollegeScoreDAL.cs 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Linq.Expressions;
  5. using System.Text;
  6. using EMIS.Entities;
  7. using EMIS.ViewModel.EvaluationManage.EvaluationManage;
  8. using EMIS.DataLogic.Repositories;
  9. namespace EMIS.DataLogic.EvaluationManage.EvaluationManage
  10. {
  11. public class EvaluationCollegeScoreDAL
  12. {
  13. public EvaluationCollegeScoreRepository EvaluationCollegeScoreRepository { get; set; }
  14. public SchoolyearRepository SchoolyearRepository { get; set; }
  15. public StaffRepository StaffRepository { get; set; }
  16. public CoursematerialRepository CoursematerialRepository { get; set; }
  17. public DepartmentRepository DepartmentRepository { get; set; }
  18. public CollegeRepository CollegeRepository { get; set; }
  19. public CampusRepository CampusRepository { get; set; }
  20. public UserRepository UserRepository { get; set; }
  21. public EvaluationStaffScoreRepository EvaluationStaffScoreRepository { get; set; }
  22. /// <summary>
  23. /// 查询对应的院系评分信息EvaluationCollegeScoreView
  24. /// </summary>
  25. /// <param name="exp"></param>
  26. /// <returns></returns>
  27. public IQueryable<EvaluationCollegeScoreView> GetEvaluationCollegeScoreViewQueryable(Expression<Func<EM_EvaluationCollegeScore, bool>> exp)
  28. {
  29. var query = from evcolsco in EvaluationCollegeScoreRepository.GetList(exp)
  30. join sy in SchoolyearRepository.Entities
  31. on evcolsco.SchoolyearID equals sy.SchoolyearID
  32. join sf in StaffRepository.Entities
  33. on evcolsco.UserID equals sf.UserID
  34. join cou in CoursematerialRepository.Entities
  35. on evcolsco.CoursematerialID equals cou.CoursematerialID
  36. join dep in DepartmentRepository.Entities
  37. on evcolsco.DepartmentID equals dep.DepartmentID
  38. join col in CollegeRepository.Entities
  39. on dep.CollegeID equals col.CollegeID
  40. join cam in CampusRepository.Entities
  41. on col.CampusID equals cam.CampusID
  42. join us in UserRepository.Entities
  43. on sf.UserID equals us.UserID
  44. select new EvaluationCollegeScoreView
  45. {
  46. EvaluationCollegeScoreID = evcolsco.EvaluationCollegeScoreID,
  47. SchoolyearID = evcolsco.SchoolyearID,
  48. SchoolyearValue = sy.Value,
  49. SchoolyearCode = sy.Code,
  50. UserID = evcolsco.UserID,
  51. StaffCode = us.LoginID,
  52. StaffName = us.Name,
  53. SexID = sf.SexID,
  54. TeacherTypeID = sf.TeacherTypeID,
  55. IncumbencyState = sf.IncumbencyState,
  56. TitleID = sf.TitleID,
  57. CoursematerialID = evcolsco.CoursematerialID,
  58. CourseCode = cou.CourseCode,
  59. CourseName = cou.CourseName,
  60. DepartmentID = evcolsco.DepartmentID,
  61. DepartmentNo = dep.No,
  62. DepartmentName = dep.Name,
  63. CollegeID = dep.CollegeID,
  64. CollegeNo = col.No,
  65. CollegeName = col.Name,
  66. CampusID = col.CampusID,
  67. CampusNo = cam.No,
  68. CampusName = cam.Name,
  69. TotalScore = evcolsco.TotalScore,
  70. ApprovalStatus = evcolsco.ApprovalStatus,
  71. Remark = evcolsco.Remark,
  72. RecordStatus = evcolsco.RecordStatus,
  73. CreateUserID = evcolsco.CreateUserID,
  74. CreateTime = evcolsco.CreateTime,
  75. ModifyUserID = evcolsco.ModifyUserID,
  76. ModifyTime = evcolsco.ModifyTime
  77. };
  78. return query;
  79. }
  80. }
  81. }