GraduationSchoolYearDAL.cs 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Linq.Expressions;
  6. using EMIS.DataLogic.Repositories;
  7. using EMIS.Entities;
  8. using EMIS.ViewModel.GraduationManage.GraduationSetting;
  9. namespace EMIS.DataLogic.GraduationManage.GraduationSetting
  10. {
  11. public class GraduationSchoolYearDAL
  12. {
  13. public GraduateSchoolyearRepository GraduateSchoolyearRepository { get; set; }
  14. public SchoolyearRepository SchoolyearRepository { get; set; }
  15. public DictionaryItemRepository DictionaryItemRepository { get; set; }
  16. /// <summary>
  17. /// 查询对应的毕业学期信息View
  18. /// </summary>
  19. /// <param name="exp"></param>
  20. /// <param name="GraduatingSemesterID"></param>
  21. /// <returns></returns>
  22. public IQueryable<GraduationSchoolYearView> GetGraduationSchoolYearViewQueryable(Expression<Func<ER_GraduateSchoolyear, bool>> exp, Guid? GraduatingSemesterID)
  23. {
  24. var query = from grsy in GraduateSchoolyearRepository.GetList(exp)
  25. join sy in SchoolyearRepository.Entities
  26. on grsy.SchoolyearID equals sy.SchoolyearID
  27. select new GraduationSchoolYearView
  28. {
  29. GraduationSchoolYearSettingID = grsy.GraduateSchoolyearID,
  30. GraduatingSemesterID = grsy.SchoolyearID,
  31. GraduatingSemesterCode = sy.Code,
  32. Years = sy.Years,
  33. SchoolcodeID = sy.SchoolcodeID,
  34. WeeksNum = sy.WeeksNum,
  35. WeekDays = sy.WeekDays,
  36. GraduateDate = grsy.GraduateDate,
  37. IsCurrent = sy.IsCurrent,
  38. IsCurrentName = sy.IsCurrent ? "是" : "否",
  39. IsEnable = grsy.SchoolyearID == GraduatingSemesterID ? true : false,
  40. IsEnableName = grsy.SchoolyearID == GraduatingSemesterID ? "是" : "否",
  41. GraduatingSemesterValue = sy.Value,
  42. RecordStatus = grsy.RecordStatus,
  43. CreateUserID = grsy.CreateUserID,
  44. CreateTime = grsy.CreateTime,
  45. ModifyUserID = grsy.ModifyUserID,
  46. ModifyTime = grsy.ModifyTime
  47. };
  48. return query;
  49. }
  50. }
  51. }