MinorGraduationConditionPackageDAL.cs 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using EMIS.DataLogic.Repositories;
  6. using EMIS.ViewModel.MinorGraduation.MinorGraduationSetting;
  7. using System.Linq.Expressions;
  8. using EMIS.Entities;
  9. namespace EMIS.DataLogic.MinorGraduation.MinorGraduationSetting
  10. {
  11. public class MinorGraduationConditionPackageDAL
  12. {
  13. public MinorGraduationConditionPackageRepository minorGraduationConditionPackageRepository { get; set; }
  14. public MinorGraduationConditionRepository minorGraduationConditionRepository { get; set; }
  15. public MinorGraduationApplyRepository minorGraduationApplyRepository { get; set; }
  16. /// <summary>
  17. /// 查询辅修毕业公式信息
  18. /// </summary>
  19. /// <param name="exp"></param>
  20. /// <returns></returns>
  21. public IQueryable<MinorGraduationConditionPackageView> GetMinorGraduationConditionPackageQueryable(Expression<Func<ER_MinorGraduationConditionPackage, bool>> exp)
  22. {
  23. var query = from gp in minorGraduationConditionPackageRepository.GetList(exp)
  24. select new MinorGraduationConditionPackageView
  25. {
  26. MinorGraduationConditionPackageID = gp.MinorGraduationConditionPackageID,
  27. Title = gp.Title,
  28. StudentTypeID = gp.StudentType,
  29. IsDefault = gp.IsDefault.Value,
  30. IsEnable = gp.RecordStatus.Value > 0 ? true : false,
  31. RecordStatus = gp.RecordStatus,
  32. CreateUserID = gp.CreateUserID,
  33. CreateTime = gp.CreateTime,
  34. ModifyUserID = gp.ModifyUserID,
  35. ModifyTime = gp.ModifyTime
  36. };
  37. return query;
  38. }
  39. /// <summary>
  40. /// 查询毕业公式中对应的毕业条件信息View(MinorGraduationConditionView)
  41. /// </summary>
  42. /// <param name="exp"></param>
  43. /// <returns></returns>
  44. public IQueryable<MinorGraduationConditionView> MinorGraduationConditionQueryable(Expression<Func<ER_MinorGraduationConditionPackage, bool>> exp)
  45. {
  46. var query = from gp in minorGraduationConditionPackageRepository.GetList(exp)
  47. from gc in gp.ER_MinorGraduationCondition
  48. select new MinorGraduationConditionView
  49. {
  50. MinorGraduationConditionID = gc.MinorGraduationConditionID,
  51. Title = gc.Title,
  52. MethodFullName = gc.MethodFullName,
  53. };
  54. return query;
  55. }
  56. }
  57. }