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.EnrollManage.SpecialtyManage; using EMIS.DataLogic.Repositories; namespace EMIS.DataLogic.EnrollManage.SpecialtyManage { public class CustomStandardSettingDAL { public CustomStandardSettingRepository customStandardSettingRepository { get; set; } public CollegeRepository collegeRepository { get; set; } public SpecialtyRepository specialtyRepository { get; set; } public DictionaryItemRepository dictionaryItemRepository { get; set; } /// /// 查询对应的省招专业信息View /// /// /// public IQueryable GetCustomStandardSettingViewQueryable(Expression> exp) { var query = from cus in customStandardSettingRepository.GetList(exp) join col in collegeRepository.Entities on cus.CollegeID equals col.CollegeID join sp in specialtyRepository.Entities on cus.SpecialtyID equals sp.SpecialtyID into tempsp from cussp in tempsp.DefaultIfEmpty() join stdic in dictionaryItemRepository.GetList(x => x.DictionaryCode == DictionaryItem.CF_Standard.ToString()) on cussp.StandardID equals stdic.Value into tempstan from dtstan in tempstan.DefaultIfEmpty() select new CustomStandardSettingView { CustomStandardSettingID = cus.CustomStandardSettingID, Code = cus.Code, Name = dtstan.Name, YearID = cus.YearID, SemesterID = cus.SemesterID, CollegeID = cus.CollegeID, CollegeCode = col.No, CollegeName = col.Name, CampusID = col.CampusID, CampusCode = col.CF_Campus.No, CampusName = col.CF_Campus.Name, SpecialtyID = cus.SpecialtyID, StandardID = cussp.StandardID, StandardName = dtstan.Name, EducationID = cussp.EducationID, LearningformID = cussp.LearningformID, LearnSystem = cussp.LearnSystem, ScienceclassID = cussp.ScienceclassID, PropertyID = cussp.PropertyID, StandardTitle = cussp.StandardTitle, StandardLevel = cussp.StandardLevel, Remark = cus.Remark, RecordStatus = cus.RecordStatus, CreateUserID = cus.CreateUserID, CreateTime = cus.CreateTime, ModifyUserID = cus.ModifyUserID, ModifyTime = cus.ModifyTime }; return query; } } }