EvaluationProjectDAL.cs 2.1 KB

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