123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Linq.Expressions;
- using System.Text;
- using EMIS.Entities;
- using EMIS.ViewModel.UniversityManage.AdministrativeOrgan;
- using EMIS.DataLogic.Repositories;
- namespace EMIS.DataLogic.UniversityManage.AdministrativeOrgan
- {
- public class UniversityDAL
- {
- public UniversityRepository UniversityRepository { get; set; }
- public UniversityProfileRepository UniversityProfileRepository { get; set; }
- public UserRepository UserRepository { get; set; }
- /// <summary>
- /// 查询学校信息View
- /// </summary>
- /// <returns></returns>
- public IQueryable<UniversityView> GetUniversityViewQueryable(Expression<Func<CF_University, bool>> expUniversity)
- {
- var query = from uy in UniversityRepository.GetList(expUniversity)
- join pf in UniversityProfileRepository.Entities
- on uy.UniversityID equals pf.UniversityID into temppf
- from uypf in temppf.DefaultIfEmpty()
- join pmus in UserRepository.Entities
- on uypf.PartyManageID equals pmus.UserID into temppm
- from uypm in temppm.DefaultIfEmpty()
- select new UniversityView
- {
- UniversityID = uy.UniversityID,
- Code = uy.Code,
- Name = uy.Name,
- SimpleName = uy.SimpleName,
- EnglishName = uy.EnglishName,
- ProvinceID = uypf.ProvinceID,
- CityID = uypf.CityID,
- DistrictID = uypf.DistrictID,
- PropertyID = uypf.PropertyID,
- SchoolTypeID = uypf.SchoolTypeID,
- ManagerID = uypf.ManagerID,
- FounderTypeID = uypf.FounderTypeID,
- SchoolLevelID = uypf.SchoolLevelID,
- HeadMasterName = uypf.HeadMasterName,
- PartyManageID = uypf.PartyManageID,
- PartyManageName = uypm.Name,
- LegalPersonName = uypf.LegalPersonName,
- BuildDate = uypf.BuildDate,
- AnniversaryDate = uypf.AnniversaryDate,
- SchoolBasis = uypf.SchoolBasis,
- SchoolMotto = uypf.SchoolMotto,
- SubjectCount = uypf.SubjectCount,
- Is211University = uypf.Is211University ?? false,
- IsKeyUniversity = uypf.IsKeyUniversity ?? false,
- IsAdultCollege = uypf.IsAdultCollege ?? false,
- IsPostCollege = uypf.IsPostCollege ?? false,
- IsNetCollege = uypf.IsNetCollege ?? false,
- Telephone = uypf.Telephone,
- ZIPCode = uypf.ZIPCode,
- Email = uypf.Email,
- FAX = uypf.FAX,
- PublicNum = uypf.PublicNum,
- HomePage = uypf.HomePage,
- Address = uypf.Address,
- EnglishAddress = uypf.EnglishAddress,
- HistoryEvolution = uypf.HistoryEvolution,
- Remark = uy.Remark,
- RecordStatus = uy.RecordStatus,
- CreateUserID = uy.CreateUserID,
- CreateTime = uy.CreateTime,
- ModifyUserID = uy.ModifyUserID,
- ModifyTime = uy.ModifyTime
- };
- return query;
- }
- }
- }
|