123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Linq.Expressions;
- using System.Text;
- using EMIS.DataLogic.Repositories;
- using EMIS.Entities;
- using EMIS.ViewModel;
- using EMIS.ViewModel.EnrollManage.SpecialtyManage;
- namespace EMIS.DataLogic.EnrollManage.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 spe in SpecialtyRepository.GetList(expSpecialty)
- join stan in DictionaryItemRepository.GetList(x => x.DictionaryCode == DictionaryItem.CF_Standard.ToString())
- on spe.StandardID equals stan.Value into tempstan
- from dtstan in tempstan.DefaultIfEmpty()
- select new SpecialtyView
- {
- SpecialtyID = spe.SpecialtyID,
- StandardID = spe.StandardID,
- StandardCode = dtstan.Code,
- StandardName = dtstan.Name,
- EducationID = spe.EducationID,
- LearningformID = spe.LearningformID,
- LearnSystem = spe.LearnSystem,
- ScienceclassID = spe.ScienceclassID,
- PropertyID = spe.PropertyID,
- StandardTitle = spe.StandardTitle,
- StandardLevel = spe.StandardLevel,
- RecordStatus = spe.RecordStatus,
- Remark = spe.Remark,
- CreateUserID = spe.CreateUserID,
- CreateTime = spe.CreateTime,
- ModifyUserID = spe.ModifyUserID,
- ModifyTime = spe.ModifyTime,
- };
- return query;
- }
- /// <summary>
- /// 查询专业信息中专业名称(去重)
- /// </summary>
- /// <param name="exp"></param>
- /// <returns></returns>
- public IQueryable<SpecialtyView> GetStandardViewQueryable(Expression<Func<CF_Specialty, bool>> exp)
- {
- var query = from spe in SpecialtyRepository.GetList(exp)
- join dtstan in DictionaryItemRepository.GetList(x => x.DictionaryCode == DictionaryItem.CF_Standard.ToString())
- on spe.StandardID equals dtstan.Value
- select new SpecialtyView
- {
- StandardID = spe.StandardID,
- StandardCode = dtstan.Code,
- StandardName = dtstan.Name
- };
- return query.Distinct();
- }
- /// <summary>
- /// 查询专业信息中学制信息(去重)
- /// </summary>
- /// <param name="exp"></param>
- /// <returns></returns>
- public IQueryable<SpecialtyView> GetLearnSystemViewQueryable(Expression<Func<CF_Specialty, bool>> exp)
- {
- var query = from spe in SpecialtyRepository.GetList(exp)
- select new SpecialtyView
- {
- LearnSystem = spe.LearnSystem
- };
- return query.Distinct();
- }
- }
- }
|