using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EMIS.DataLogic.Repositories;
using System.Linq.Expressions;
using EMIS.Entities;
using EMIS.ViewModel.EvaluationManage;
namespace EMIS.DataLogic.Common.EvaluationManage
{
public class EvaluationProjectDAL
{
public EvaluationProjectRepository evaluationProjectRepository { get; set; }
public EvaluationTargetRepository evaluationTargetRepository { get; set; }
public EvaluationEnterRepository evaluationEnterRepository { get; set; }
///
/// 读取评价项目信息
///
///
///
public IQueryable GetEvaluationProjectQueryable(Expression> exp)
{
var query = from a in evaluationProjectRepository.GetList(exp)
join b in evaluationTargetRepository.Entities on a.EvaluationTargetID equals b.EvaluationTargetID
select new EvaluationProjectView
{
ProjectID = a.EvaluationProjectID,
Code = a.Code,
Name = a.Name,
OrderID = a.OrderNo,
Weight = a.Weight,
TargetID = a.EvaluationTargetID,
TargetCode=b.Code,
TargetName=b.Name,
TableID=b.EM_EvaluationTable.EvaluationTableID,
TableCode=b.EM_EvaluationTable.Code,
TableName=b.EM_EvaluationTable.Name,
NormID=b.EM_EvaluationNorm.EvaluationNormID,
NormName=b.EM_EvaluationNorm.Name,
Remark=a.Remark,
CreateUserID = a.CreateUserID,
CreateTime = a.CreateTime,
TargetWeight = b.Weight //评价指标权重
};
return query;
}
}
}