EvaluationTypeDAL.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using EMIS.DataLogic.Repositories;
  6. using System.Linq.Expressions;
  7. using EMIS.Entities;
  8. using EMIS.ViewModel.EvaluationManage;
  9. namespace EMIS.DataLogic.Common.EvaluationManage
  10. {
  11. public class EvaluationTypeDAL
  12. {
  13. public EvaluationTypeRepository evaluationTypeRepository { get; set; }
  14. public DictionaryItemRepository dictionaryItemRepository { get; set; }
  15. /// <summary>
  16. /// 读取参评类型信息
  17. /// </summary>
  18. /// <param name="exp"></param>
  19. /// <returns></returns>
  20. public IQueryable<EvaluationTypeView> GetEvaluationTypeQueryable(Expression<Func<EM_EvaluationType, bool>> exp)
  21. {
  22. var query = from a in evaluationTypeRepository.GetList(exp)
  23. select new EvaluationTypeView
  24. {
  25. TypeID = a.EvaluationTypeID,
  26. //Code = a.Code,
  27. Name = a.Name,
  28. IsStudent = a.IsStudent.Value,
  29. Student = (a.IsStudent.HasValue && a.IsStudent == true) ? "是" : "否",
  30. IsDefault = a.IsStudent.Value,
  31. Default = (a.IsStudent.HasValue && a.IsStudent == true) ? "是" : "否",
  32. StartTime = a.StartTime,
  33. EndTime = a.EndTime,
  34. Number=a.Number,
  35. Remark=a.Remark,
  36. CreateUserID = a.CreateUserID,
  37. CreateTime = a.CreateTime
  38. };
  39. return query;
  40. }
  41. }
  42. }