StudentFamilyDAL.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  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.Students;
  7. using System.Linq.Expressions;
  8. using EMIS.Entities;
  9. namespace EMIS.DataLogic.Common.Students
  10. {
  11. public class StudentFamilyDAL
  12. {
  13. public StudentFamilyRepository StudentFamilyRepository { get; set; }
  14. public IQueryable<StudentFamilyView> GetStudentFamilyViewQueryable(Expression<Func<CF_StudentFamily, bool>> exp)
  15. {
  16. var query = (from family in StudentFamilyRepository.GetList(exp)
  17. orderby family.OrderNo
  18. select new StudentFamilyView
  19. {
  20. StudentFamilyID = family.StudentFamilyID,
  21. UserID = family.UserID,
  22. Name = family.Name,
  23. Relation = family.Relation,
  24. Age = family.Age,
  25. Politics = family.Politics,
  26. Unit = family.Unit,
  27. PhoneNumber = family.PhoneNumber
  28. });
  29. return query;
  30. }
  31. }
  32. }