1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Linq.Expressions;
- using System.Text;
- using EMIS.Entities;
- using EMIS.ViewModel.EvaluationManage.EvaluationSetting;
- using EMIS.DataLogic.Repositories;
- namespace EMIS.DataLogic.EvaluationManage.EvaluationSetting
- {
- public class EvaluationNeedDAL
- {
- public EvaluationNeedRepository EvaluationNeedRepository { get; set; }
- public UserRepository UserRepository { get; set; }
- /// <summary>
- /// 查询对应的评价需知信息EvaluationNeedView
- /// </summary>
- /// <param name="expEvaluationNeed"></param>
- /// <returns></returns>
- public IQueryable<EvaluationNeedView> GetEvaluationNeedViewQueryable(Expression<Func<EM_EvaluationNeed, bool>> expEvaluationNeed)
- {
- var query = from evnd in EvaluationNeedRepository.GetList(expEvaluationNeed)
- join usc in UserRepository.Entities
- on evnd.CreateUserID equals usc.UserID into tempusc
- from uscu in tempusc.DefaultIfEmpty()
- join usm in UserRepository.Entities
- on evnd.ModifyUserID equals usm.UserID into tempusm
- from usmu in tempusm.DefaultIfEmpty()
- select new EvaluationNeedView
- {
- EvaluationNeedID = evnd.EvaluationNeedID,
- Code = evnd.Code,
- Title = evnd.Title,
- ParticipateTypeID = evnd.ParticipateTypeID,
- Content = evnd.Content,
- IsEnabled = evnd.IsEnabled.Value,
- Remark = evnd.Remark,
- RecordStatus = evnd.RecordStatus,
- CreateUserID = evnd.CreateUserID,
- CreateUserName = uscu.Name,
- CreateTime = evnd.CreateTime,
- ModifyUserID = evnd.ModifyUserID,
- ModifyUserName = usmu.Name,
- ModifyTime = evnd.ModifyTime
- };
- return query;
- }
- }
- }
|