1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Linq.Expressions;
- using System.Text;
- using EMIS.Entities;
- using EMIS.ViewModel.EvaluationManage.EvaluationTable;
- using EMIS.DataLogic.Repositories;
- namespace EMIS.DataLogic.EvaluationManage.EvaluationTable
- {
- public class EvaluationNormDAL
- {
- public EvaluationNormRepository EvaluationNormRepository { get; set; }
- public EvaluationNormDetailRepository EvaluationNormDetailRepository { get; set; }
- public UserRepository UserRepository { get; set; }
- /// <summary>
- /// 查询对应的评分标准信息EvaluationNormView
- /// </summary>
- /// <param name="exp"></param>
- /// <returns></returns>
- public IQueryable<EvaluationNormView> GetEvaluationNormViewQueryable(Expression<Func<EM_EvaluationNorm, bool>> exp)
- {
- var query = from evnm in EvaluationNormRepository.GetList(exp)
- join usc in UserRepository.Entities
- on evnm.CreateUserID equals usc.UserID into tempusc
- from uscu in tempusc.DefaultIfEmpty()
- join usm in UserRepository.Entities
- on evnm.ModifyUserID equals usm.UserID into tempusm
- from usmu in tempusm.DefaultIfEmpty()
- select new EvaluationNormView
- {
- EvaluationNormID = evnm.EvaluationNormID,
- Name = evnm.Name,
- NormTypeID = evnm.NormTypeID,
- SatisfyWeight = evnm.SatisfyWeight,
- NormDetailList = evnm.EM_EvaluationNormDetail.OrderBy(x => x.OrderNo).Select(x => x.Name).ToList(),
- Remark = evnm.Remark,
- RecordStatus = evnm.RecordStatus,
- CreateUserID = evnm.CreateUserID,
- CreateUserName = uscu.Name,
- CreateTime = evnm.CreateTime,
- ModifyUserID = evnm.ModifyUserID,
- ModifyUserName = usmu.Name,
- ModifyTime = evnm.ModifyTime
- };
- return query;
- }
- /// <summary>
- /// 查询对应的评分标准明细信息EvaluationNormDetailView
- /// </summary>
- /// <param name="exp"></param>
- /// <returns></returns>
- public IQueryable<EvaluationNormDetailView> GetEvaluationNormDetailViewQueryable(Expression<Func<EM_EvaluationNormDetail, bool>> exp)
- {
- var query = from evnmdtl in EvaluationNormDetailRepository.GetList(exp)
- join evnm in EvaluationNormRepository.Entities
- on evnmdtl.EvaluationNormID equals evnm.EvaluationNormID
- select new EvaluationNormDetailView
- {
- EvaluationNormDetailID = evnmdtl.EvaluationNormDetailID,
- EvaluationNormID = evnmdtl.EvaluationNormID,
- EvaluationNormName = evnm.Name,
- OrderNo = evnmdtl.OrderNo,
- Name = evnmdtl.Name,
- Weight = evnmdtl.Weight,
- NormTypeID = evnm.NormTypeID,
- Remark = evnmdtl.Remark,
- RecordStatus = evnmdtl.RecordStatus,
- CreateUserID = evnmdtl.CreateUserID,
- CreateTime = evnmdtl.CreateTime,
- ModifyUserID = evnmdtl.ModifyUserID,
- ModifyTime = evnmdtl.ModifyTime
- };
- return query;
- }
- }
- }
|