12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Linq.Expressions;
- using EMIS.Entities;
- using EMIS.ViewModel.UniversityManage.AdministrativeOrgan;
- using EMIS.ViewModel.EducationManage;
- using EMIS.DataLogic.Repositories;
- namespace EMIS.DataLogic.EducationManage
- {
- public class EducationMissionOpenControlDAL
- {
- public EducationMissionOpenControlRepository EducationMissionOpenControlRepository { get; set; }
- public CollegeRepository CollegeRepository { get; set; }
- public CampusRepository CampusRepository { get; set; }
- public UserRepository UserRepository { get; set; }
- /// <summary>
- /// 查询对应的教学任务控制信息View
- /// </summary>
- /// <param name="exp"></param>
- /// <returns></returns>
- public IQueryable<EducationMissionOpenControlView> GetEducationMissionOpenControlViewQueryable(Expression<Func<EM_EducationMissionOpenControl, bool>> exp)
- {
- var query = from ec in EducationMissionOpenControlRepository.GetList(exp)
- join cus in UserRepository.Entities
- on ec.CreateUserID equals cus.UserID into tempcus
- from eccus in tempcus.DefaultIfEmpty()
- select new EducationMissionOpenControlView
- {
- EducationMissionOpenControlID = ec.EducationMissionOpenControlID,
- CollegeID = ec.CollegeID,
- CollegeNo = ec.CF_College.No,
- CollegeName = ec.CF_College.Name,
- UnitCategoryID = ec.CF_College.CF_CollegeProfile.UnitCategoryID,
- CampusID = ec.CF_College.CampusID,
- CampusNo = ec.CF_College.CF_Campus.No,
- CampusName = ec.CF_College.CF_Campus.Name,
- SchoolyearID = ec.SchoolyearID,
- SchoolyearCode = ec.CF_Schoolyear.Code,
- Value = ec.CF_Schoolyear.Value,
- StartDate = ec.StartDate,
- EndDate = ec.EndDate,
- RecordStatus = ec.RecordStatus,
- CreateUserID = ec.CreateUserID,
- CreateUserName = eccus.Name,
- CreateTime = ec.CreateTime,
- ModifyUserID = ec.ModifyUserID,
- ModifyTime = ec.ModifyTime
- };
- return query;
- }
- /// <summary>
- /// 查询教学控制中未新增的院系所信息CollegeView
- /// </summary>
- /// <param name="expCollege"></param>
- /// <param name="expEduOpenControl"></param>
- /// <returns></returns>
- public IQueryable<CollegeView> GetCollegeViewNoAddQueryable(Expression<Func<CF_College, bool>> expCollege, Expression<Func<EM_EducationMissionOpenControl, bool>> expEduOpenControl)
- {
- var query = from col in CollegeRepository.GetList(expCollege)
- join cam in CampusRepository.Entities
- on col.CampusID equals cam.CampusID
- join ec in EducationMissionOpenControlRepository.GetList(expEduOpenControl)
- on col.CollegeID equals ec.CollegeID into tempec
- from colec in tempec.DefaultIfEmpty()
- where colec.EducationMissionOpenControlID == null
- select new CollegeView
- {
- CollegeID = col.CollegeID,
- No = col.No,
- Name = col.Name,
- SimpleName = col.SimpleName,
- CampusID = col.CampusID,
- CampusNo = cam.No,
- CampusName = cam.Name,
- UnitCategoryID = col.CF_CollegeProfile.UnitCategoryID,
- CollegeTypeID = col.CF_CollegeProfile.CollegeTypeID,
- CollegeCategoryID = col.CF_CollegeProfile.CollegeCategoryID,
- Officephone = col.CF_CollegeProfile.Officephone,
- Remark = col.Remark,
- RecordStatus = col.RecordStatus,
- CreateUserID = col.CreateUserID,
- CreateTime = col.CreateTime,
- ModifyUserID = col.ModifyUserID,
- ModifyTime = col.ModifyTime
- };
- return query;
- }
- }
- }
|