InSchoolStatusSettingDAL.cs 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using EMIS.ViewModel.SystemView;
  6. using EMIS.Entities;
  7. using System.Linq.Expressions;
  8. using EMIS.DataLogic.Repositories;
  9. using EMIS.ViewModel.TeacherManagement;
  10. using EMIS.ViewModel.Students;
  11. namespace EMIS.DataLogic.Common.Students
  12. {
  13. public class InSchoolStatusSettingDAL
  14. {
  15. public DictionaryItemRepository dictionaryItemView { get; set; }
  16. public InSchoolSettingRepository inSchoolSettingRepository { get; set; }
  17. /// <summary>
  18. /// 查询字典元素信息
  19. /// </summary>
  20. /// <param name="exp"></param>
  21. /// <returns></returns>
  22. public IQueryable<InSchoolStatusView> GetdicViewQueryable(Expression<Func<Sys_DictionaryItem, bool>> exp)
  23. {
  24. var query = from a in dictionaryItemView.GetList(exp)
  25. join b in inSchoolSettingRepository.Entities on a.Value equals b.InSchoolStatusID into gsp
  26. from gisp in gsp.DefaultIfEmpty()
  27. select new InSchoolStatusView
  28. {
  29. DictionaryItemID = a.DictionaryItemID,
  30. Code = a.Code,
  31. DictionaryCode = a.DictionaryCode,
  32. Value = a.Value,
  33. Name = a.Name,
  34. OrderNo = a.OrderNo,
  35. Sys_RecordStatus = a.RecordStatus,
  36. IsEditable = a.IsEditable,
  37. InSchoolSettingID = gisp.InSchoolSettingID,
  38. InSchoolStatusID = gisp.InSchoolStatusID,
  39. IsSelected = gisp.IsSelected == true ? true : false,
  40. RecordStatus = gisp.RecordStatus,
  41. CreateTime = gisp.CreateTime,
  42. CreateUserID = gisp.CreateUserID,
  43. ModifyTime = gisp.ModifyTime,
  44. ModifyUserID = gisp.ModifyUserID
  45. };
  46. return query;
  47. }
  48. }
  49. }