EvaluationTableDAL.cs 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. using EMIS.ViewModel;
  10. namespace EMIS.DataLogic.Common.EvaluationManage
  11. {
  12. public class EvaluationTableDAL
  13. {
  14. public EvaluationTableRepository evaluationTableRepository { get; set; }
  15. public DictionaryItemRepository dictionaryItemRepository { get; set; }
  16. public EvaluationTypeRepository evaluationTypeRepository { get; set; }
  17. /// <summary>
  18. /// 读取评价表信息
  19. /// </summary>
  20. /// <param name="exp"></param>
  21. /// <returns></returns>
  22. public IQueryable<EvaluationTableView> GetEvaluationTableQueryable(Expression<Func<EM_EvaluationTable, bool>> exp)
  23. {
  24. var query = from a in evaluationTableRepository.GetList(exp)
  25. join c in evaluationTypeRepository.Entities on a.EvaluationTypeID equals c.EvaluationTypeID
  26. select new EvaluationTableView
  27. {
  28. TableID = a.EvaluationTableID,
  29. Code = a.Code,
  30. Name = a.Name,
  31. EvaluationType = c.Name,
  32. Weight = a.Weight,
  33. Remark = a.Remark,
  34. EvaluationIntTypeID = a.EvaluationIntTypeID,
  35. EvaluationIntTypeName = a.EM_EvaluationIntType.Name,
  36. CreateUserID = a.CreateUserID,
  37. CreateTime = a.CreateTime,
  38. IsEnabled = a.IsEnabled == true ? (int)CF_YesOrNoStatus.Yes : (int)CF_YesOrNoStatus.No,
  39. IsEnabledName = a.IsEnabled == true ? "是" : "否"//是否启用
  40. };
  41. return query.Distinct();
  42. }
  43. }
  44. }