123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- using EMIS.Entities;
- using EMIS.ViewModel.EvaluationManage;
- using EMIS.DataLogic.Repositories;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Linq.Expressions;
- using System.Text;
- using EMIS.ViewModel;
- namespace EMIS.DataLogic.Common.EvaluationManage
- {
- public class EvaluationIntTypeDAL
- {
- public EvaluationIntTypeRepository evaluationIntTypeRepository { get; set; }
- public EvaluationTeachingModeRepository evaluationTeachingModeRepository { get; set; }
- public DictionaryItemRepository dictionaryItemRepository { get; set; }
- /// <summary>
- /// 读取评价类型信息
- /// </summary>
- /// <param name="exp"></param>
- /// <returns></returns>
- public IQueryable<EvaluationIntTypeView> GetEvaluationIntTypeQueryable(Expression<Func<EM_EvaluationIntType, bool>> exp)
- {
- var query = from a in evaluationIntTypeRepository.GetList(exp)
- select new EvaluationIntTypeView
- {
- Remark = a.Remark,
- Code = a.Code,
- Name = a.Name,
- EvaluationIntTypeID = a.EvaluationIntTypeID
- };
- return query;
- }
- public List<TeachingModeTypeView> GetEvaluationTeachingModeTypeQuery(Expression<Func<EM_EvaluationTeachingMode, bool>> exp)
- {
- var query = (from evainTmode in evaluationTeachingModeRepository.GetList(exp)
- join b in dictionaryItemRepository.Entities on new { TeachingModeType = evainTmode.TeachingModeID, DictionaryCode = typeof(CF_TeachingMode).Name }
- equals new { TeachingModeType = b.Value, b.DictionaryCode }
- into dicTep
- from dictab in dicTep.DefaultIfEmpty()
- select new TeachingModeTypeView
- {
- EvaluationIntTypeID = evainTmode.EvaluationIntTypeID,
- TeachingModeType = evainTmode.TeachingModeID,
- TeachingModeTypeName = dictab.Name
- });
- return query.ToList();
- }
- /// <summary>
- /// 根据教室ID获取教室类型
- /// </summary>
- /// <param name="specialtyCourseID"></param>
- /// <returns></returns>
- public List<int> GetTeachingModeTypeQueryble(Guid? evaluationIntTypeID)
- {
- var query = from a in evaluationTeachingModeRepository.Entities.Where(x => x.EvaluationIntTypeID == evaluationIntTypeID)
- join b in dictionaryItemRepository.Entities on new { TeachingModeType = a.TeachingModeID, DictionaryCode = DictionaryItem.CF_TeachingMode.ToString() }
- equals new { TeachingModeType = b.Value, b.DictionaryCode }
- select b.Value.Value;
- return query.ToList();
- }
- }
- }
|