12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using EMIS.DataLogic.Repositories;
- using EMIS.ViewModel.Specialtymanage;
- using System.Linq.Expressions;
- using EMIS.Entities;
- using EMIS.ViewModel;
- namespace EMIS.DataLogic.Common.Specialtymanage
- {
- public class SpecialtyDAL
- {
- public SpecialtyRepository SpecialtyRepository { get; set; }
- public DictionaryItemRepository DictionaryItemRepository { get; set; }
- /// <summary>
- /// 查询对应的专业信息View
- /// </summary>
- /// <param name="expSpecialty"></param>
- /// <returns></returns>
- public IQueryable<SpecialtyView> GetSpecialtyViewQueryable(Expression<Func<CF_Specialty, bool>> expSpecialty)
- {
- var query = from a in SpecialtyRepository.GetList(expSpecialty)
- join b in DictionaryItemRepository.GetList(x => x.DictionaryCode == DictionaryItem.CF_Standard.ToString())
- on a.StandardID equals b.Value into temp
- from standard in temp.DefaultIfEmpty()
- select new SpecialtyView
- {
- SpecialtyID = a.SpecialtyID,
- StandardID = a.StandardID,
- StandardCode = standard.Code,
- StandardName = standard.Name,
- EducationID = a.EducationID,
- LearningformID = a.LearningformID,
- LearnSystem = a.LearnSystem,
- ScienceclassID = a.ScienceclassID,
- PropertyID = a.PropertyID,
- StandardTitle = a.StandardTitle,
- StandardLevel = a.StandardLevel,
- RecordStatus = a.RecordStatus,
- Remark = a.Remark,
- CreateUserID = a.CreateUserID,
- CreateTime = a.CreateTime,
- ModifyUserID = a.ModifyUserID,
- ModifyTime = a.ModifyTime,
- };
- return query;
- }
-
- /// <summary>
- /// 查询专业信息中学制信息(去重)
- /// </summary>
- /// <param name="exp"></param>
- /// <returns></returns>
- public IQueryable<SpecialtyView> GetLearnSystemQueryable(Expression<Func<CF_Specialty, bool>> exp)
- {
- var query = from a in SpecialtyRepository.GetList(exp)
- select new SpecialtyView
- {
- LearnSystem = a.LearnSystem
- };
- return query.Distinct();
- }
- }
- }
|