EvaluationTargetDAL.cs 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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 EvaluationTargetDAL
  12. {
  13. public EvaluationTargetRepository evaluationTargetRepository { get; set; }
  14. public EvaluationNormRepository evaluationNormRepository { get; set; }
  15. public EvaluationTableRepository evaluationTableRepository { get; set; }
  16. public EvaluationProjectRepository evaluationProjectRepository { get; set; }
  17. public EvaluationEnterRepository evaluationEnterRepository { get; set; }
  18. /// <summary>
  19. /// 读取评价指标信息
  20. /// </summary>
  21. /// <param name="exp"></param>
  22. /// <returns></returns>
  23. public IQueryable<EvaluationTargetView> GetEvaluationTargetQueryable(Expression<Func<EM_EvaluationTarget, bool>> exp)
  24. {
  25. var query = from a in evaluationTargetRepository.GetList(exp)
  26. join b in evaluationNormRepository.Entities on a.EvaluationNormID equals b.EvaluationNormID
  27. join c in evaluationTableRepository.Entities on a.EvaluationTableID equals c.EvaluationTableID
  28. select new EvaluationTargetView
  29. {
  30. TargetID = a.EvaluationTargetID,
  31. Code = a.Code,
  32. Name = a.Name,
  33. OrderID = a.OrderNo,
  34. Weight = a.Weight,
  35. NormID = a.EvaluationNormID,
  36. NormName = b.Name,
  37. TableID = a.EvaluationTableID,
  38. TableCode = c.Code,
  39. TableName = c.Name,
  40. Remark = a.Remark,
  41. CreateUserID = a.CreateUserID,
  42. CreateTime = a.CreateTime
  43. };
  44. return query;
  45. }
  46. }
  47. }