1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Linq.Expressions;
- using System.Text;
- using EMIS.Entities;
- using EMIS.ViewModel;
- using EMIS.ViewModel.EvaluationManage.EvaluationSetting;
- using EMIS.DataLogic.Repositories;
- namespace EMIS.DataLogic.EvaluationManage.EvaluationSetting
- {
- public class EvaluationIntTypeDAL
- {
- public EvaluationIntTypeRepository EvaluationIntTypeRepository { get; set; }
- public EvaluationTeachingModeRepository EvaluationTeachingModeRepository { get; set; }
- public DictionaryItemRepository DictionaryItemRepository { get; set; }
- public UserRepository UserRepository { get; set; }
- /// <summary>
- /// 查询对应的评价类型信息EvaluationIntTypeView
- /// </summary>
- /// <param name="exp"></param>
- /// <returns></returns>
- public IQueryable<EvaluationIntTypeView> GetEvaluationIntTypeViewQueryable(Expression<Func<EM_EvaluationIntType, bool>> exp)
- {
- var query = from evit in EvaluationIntTypeRepository.GetList(exp)
- join usc in UserRepository.Entities
- on evit.CreateUserID equals usc.UserID into tempusc
- from uscu in tempusc.DefaultIfEmpty()
- join usm in UserRepository.Entities
- on evit.ModifyUserID equals usm.UserID into tempusm
- from usmu in tempusm.DefaultIfEmpty()
- select new EvaluationIntTypeView
- {
- EvaluationIntTypeID = evit.EvaluationIntTypeID,
- Code = evit.Code,
- Name = evit.Name,
- TeachingModeIDList = evit.EM_EvaluationTeachingMode.OrderBy(x => x.TeachingModeID).Select(x => x.TeachingModeID).ToList(),
- Remark = evit.Remark,
- RecordStatus = evit.RecordStatus,
- CreateUserID = evit.CreateUserID,
- CreateUserName = uscu.Name,
- CreateTime = evit.CreateTime,
- ModifyUserID = evit.ModifyUserID,
- ModifyUserName = usmu.Name,
- ModifyTime = evit.ModifyTime
- };
- return query;
- }
- /// <summary>
- /// 查询评价类型对应的授课方式
- /// </summary>
- /// <param name="exp"></param>
- /// <returns></returns>
- public IQueryable<int?> GetTeachingModeTypeQueryble(Expression<Func<EM_EvaluationIntType, bool>> exp)
- {
- var query = from it in EvaluationIntTypeRepository.GetList(exp)
- join tm in EvaluationTeachingModeRepository.Entities
- on it.EvaluationIntTypeID equals tm.EvaluationIntTypeID
- join dictm in DictionaryItemRepository.GetList(x => x.DictionaryCode == typeof(CF_TeachingMode).Name)
- on tm.TeachingModeID equals dictm.Value
- select dictm.Value;
- return query;
- }
- }
- }
|