1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Linq.Expressions;
- using EMIS.Entities;
- using EMIS.ViewModel.EvaluationManage.EvaluationSetting;
- using EMIS.DataLogic.Repositories;
- namespace EMIS.DataLogic.EvaluationManage.EvaluationSetting
- {
- public class EvaluationTypeDAL
- {
- public EvaluationTypeRepository EvaluationTypeRepository { get; set; }
- public UserRepository UserRepository { get; set; }
- /// <summary>
- /// 查询对应的参评类型信息EvaluationTypeView
- /// </summary>
- /// <param name="exp"></param>
- /// <returns></returns>
- public IQueryable<EvaluationTypeView> GetEvaluationTypeViewQueryable(Expression<Func<EM_EvaluationType, bool>> exp)
- {
- var query = from evtp in EvaluationTypeRepository.GetList(exp)
- join usc in UserRepository.Entities
- on evtp.CreateUserID equals usc.UserID into tempusc
- from uscu in tempusc.DefaultIfEmpty()
- join usm in UserRepository.Entities
- on evtp.ModifyUserID equals usm.UserID into tempusm
- from usmu in tempusm.DefaultIfEmpty()
- select new EvaluationTypeView
- {
- EvaluationTypeID = evtp.EvaluationTypeID,
- Name = evtp.Name,
- IsStudent = evtp.IsStudent.Value,
- Number = evtp.Number,
- StartTime = evtp.StartTime,
- EndTime = evtp.EndTime,
- Remark = evtp.Remark,
- RecordStatus = evtp.RecordStatus,
- CreateUserID = evtp.CreateUserID,
- CreateUserName = uscu.Name,
- CreateTime = evtp.CreateTime,
- ModifyUserID = evtp.ModifyUserID,
- ModifyUserName = usmu.Name,
- ModifyTime = evtp.ModifyTime
- };
- return query;
- }
- }
- }
|