123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- 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; }
- /// <summary>
- /// 查询对应的参评类型信息EvaluationParticipateTypeView
- /// </summary>
- /// <param name="exp"></param>
- /// <returns></returns>
- public IQueryable<EvaluationParticipateTypeView> GetEvaluationParticipateTypeViewQueryable(Expression<Func<EM_EvaluationParticipateType, bool>> 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;
- }
- }
- }
|