using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Linq.Expressions; using EMIS.Entities; using EMIS.ViewModel; using EMIS.ViewModel.EvaluationManage.EvaluationSetting; using EMIS.DataLogic.Repositories; namespace EMIS.DataLogic.EvaluationManage.EvaluationSetting { public class EvaluationParticipateTypeDAL { public EvaluationParticipateTypeRepository EvaluationParticipateTypeRepository { get; set; } public UserRepository UserRepository { get; set; } /// /// 查询对应的参评类型信息EvaluationParticipateTypeView /// /// /// public IQueryable GetEvaluationParticipateTypeViewQueryable(Expression> exp) { var query = from evpt in EvaluationParticipateTypeRepository.GetList(exp) join usc in UserRepository.Entities on evpt.CreateUserID equals usc.UserID into tempusc from uscu in tempusc.DefaultIfEmpty() join usm in UserRepository.Entities on evpt.ModifyUserID equals usm.UserID into tempusm from usmu in tempusm.DefaultIfEmpty() select new EvaluationParticipateTypeView { EvaluationParticipateTypeID = evpt.EvaluationParticipateTypeID, ParticipateTypeID = evpt.ParticipateTypeID, IsStudent = evpt.IsStudent.Value, Number = evpt.Number, StartTime = evpt.StartTime, EndTime = evpt.EndTime, Remark = evpt.Remark, RecordStatus = evpt.RecordStatus, CreateUserID = evpt.CreateUserID, CreateUserName = uscu.Name, CreateTime = evpt.CreateTime, ModifyUserID = evpt.ModifyUserID, ModifyUserName = usmu.Name, ModifyTime = evpt.ModifyTime }; return query; } } }