12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using EMIS.DataLogic.Repositories;
- using EMIS.ViewModel;
- using System.Linq.Expressions;
- using EMIS.Entities;
- namespace EMIS.DataLogic.Common.AdministrativeOrgan
- {
- public class CampusDAL
- {
- public CampusRepository CampusRepository { get; set; }
- public CampusProfileRepository CampusProfileRepository { get; set; }
- public UserRepository UserRepository { get; set; }
- /// <summary>
- /// 查询对应的校区信息View
- /// </summary>
- /// <param name="expCampus"></param>
- /// <returns></returns>
- public IQueryable<CampusView> GetCampusViewQueryable(Expression<Func<CF_Campus, bool>> expCampus)
- {
- var query = from a in CampusRepository.GetList(expCampus)
- join c in UserRepository.Entities
- on a.CF_CampusProfile.Generalsuper equals c.UserID
- into gg
- from gGeneralsuper in gg.DefaultIfEmpty()
- join d in UserRepository.Entities
- on a.CF_CampusProfile.Recruitstudents equals d.UserID
- into gr
- from gRecruitstudents in gr.DefaultIfEmpty()
- join e in UserRepository.Entities
- on a.CF_CampusProfile.Placesuper equals e.UserID
- into gp
- from gPlacesuper in gp.DefaultIfEmpty()
- join f in UserRepository.Entities
- on a.CF_CampusProfile.Teachingsuper equals f.UserID
- into gt
- from gTeachingsuper in gt.DefaultIfEmpty()
- join g in UserRepository.Entities
- on a.CF_CampusProfile.Studentcharge equals g.UserID
- into gsc
- from gStudentcharge in gsc.DefaultIfEmpty()
- select new CampusView
- {
- CampusID = a.CampusID,
- UniversityID = a.UniversityID,
- No = a.No,
- Name = a.Name,
- SimpleName = a.SimpleName,
- EnglishName = a.EnglishName,
- UniversityCode = a.CF_University.Code,
- UniversityName = a.CF_University.Name,
- Generalsuper = a.CF_CampusProfile.Generalsuper,
- GeneralsuperName = gGeneralsuper.Name,
- Recruitstudents = a.CF_CampusProfile.Recruitstudents,
- RecruitstudentsName = gRecruitstudents.Name,
- Placesuper = a.CF_CampusProfile.Placesuper,
- PlacesuperName = gPlacesuper.Name,
- Teachingsuper = a.CF_CampusProfile.Teachingsuper,
- TeachingsuperName = gTeachingsuper.Name,
- Studentcharge = a.CF_CampusProfile.Studentcharge,
- StudentchargeName = gStudentcharge.Name,
- ZIPCode = a.CF_CampusProfile.ZIPCode,
- Officephone = a.CF_CampusProfile.Officephone,
- FAX = a.CF_CampusProfile.FAX,
- Email = a.CF_CampusProfile.Email,
- Evolution = a.CF_CampusProfile.Evolution,
- Remark = a.Remark,
- RecordStatus = a.RecordStatus,
- CreateUserID = a.CreateUserID,
- CreateTime = a.CreateTime,
- ModifyUserID = a.ModifyUserID,
- ModifyTime = a.ModifyTime
- };
- return query;
- }
- }
- }
|