123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using EMIS.DataLogic.Repositories;
- using EMIS.ViewModel.TeacherManagement;
- using EMIS.Entities;
- using System.Linq.Expressions;
- using EMIS.ViewModel;
- namespace EMIS.DataLogic.Common.TeacherManagement
- {
- public class StaffDAL
- {
- public StaffRepository staffRepository { get; set; }
- public StaffProfileRepository staffProfileRepository { get; set; }
- public DictionaryItemRepository dictionaryItemRepository { get; set; }
- public UserRepository UserRepository { get; set; }
- public IQueryable<CF_Campus> GetUserInChargeCampus(Expression<Func<CF_Staff, bool>> exp)
- {
- var query = from s in staffRepository.GetList(exp)
- from smc in s.CF_StaffManageCampus
- select smc.CF_Campus;
- return query;
- }
- public IQueryable<CF_College> GetUserInChargeCollege(Expression<Func<CF_Staff, bool>> exp)
- {
- var query = from s in staffRepository.GetList(exp)
- from smc in s.CF_StaffManageCollege
- select smc.CF_College;
- return query;
- }
- public IQueryable<CF_Department> GetUserInChargeDepartment(Expression<Func<CF_Staff, bool>> exp)
- {
- var query = from s in staffRepository.GetList(exp)
- from smd in s.CF_StaffManageDepartment
- select smd.CF_Department;
- return query;
- }
- /// <summary>
- /// 查询教师详细信息
- /// </summary>
- /// <param name="exp"></param>
- /// <returns></returns>
- public IQueryable<StaffView> GetStaffViewQueryable(Expression<Func<CF_Staff, bool>> exp)
- {
- var query = from a in staffRepository.GetList(exp)
- select new StaffView
- {
- UserID = a.UserID,
- Name = a.Sys_User.Name,
- DepartmentID = a.DepartmentID,
- DepartmentCode = a.CF_Department.No,
- DepartmentName = a.CF_Department.Name,
- CampusID = a.CF_College.CampusID,
- CampusCode = a.CF_College.CF_Campus.No,
- CampusName = a.CF_College.CF_Campus.Name,
- CollegeID = a.CF_College.CollegeID,
- CollegeNo = a.CF_College.No,
- CollegeName = a.CF_College.Name,
- StaffCode = a.Sys_User.LoginID,
- BirthDate = a.BirthDate,
- Sex = a.Sex,
- TeacherType = a.TeacherType,
- IncumbencyState = a.IncumbencyState,
- CertificatesType = a.CertificatesType,
- CertificatesNum = a.CertificatesNum,
- Situation = a.Situation,
- LiteracyLevels = a.LiteracyLevels,
- DegreeState = a.DegreeState,
- LearnPosition = a.LearnPosition,
- Title = a.Title,
- WorkDate = a.WorkDate,
- ComeSchoolDate = a.ComeSchoolDate,
- TeachingDate = a.TeachingDate,
- PhotoUrl = a.PhotoUrl,
- Profile = a.Profile,
- UsedName = a.CF_StaffProfile.UsedName,
- Nation = a.CF_StaffProfile.Nation,
- Place = a.CF_StaffProfile.Place,
- EducationCode = a.CF_StaffProfile.EducationCode,
- Telephone = a.CF_StaffProfile.Telephone,
- OfficeTelephone = a.CF_StaffProfile.OfficeTelephone,
- Mobile = a.CF_StaffProfile.Mobile,
- Email = a.CF_StaffProfile.Email,
- QQ = a.CF_StaffProfile.QQ,
- Nationality = a.CF_StaffProfile.Nationality,
- HealthState = a.CF_StaffProfile.HealthState,
- HousePhone = a.CF_StaffProfile.HousePhone,
- Address = a.CF_StaffProfile.Address,
- Postcode = a.CF_StaffProfile.Postcode,
- HomeAddress = a.CF_StaffProfile.HomeAddress,
- NowAddress = a.CF_StaffProfile.NowAddress,
- Residence = a.CF_StaffProfile.Residence,
- Speciality = a.CF_StaffProfile.Speciality,
- WeChatNum = a.CF_StaffProfile.WeChatNum,
- Religion = a.CF_StaffProfile.Religion,
- PaymentLevelID = a.PaymentLevelID,
- IsDualTeacher = (a.IsDualTeacher ?? false),
- CreateUserID = a.CreateUserID,
- CreateTime = a.CreateTime,
- Remarks = a.Remarks,
- Account=a.CF_StaffProfile.Account
- };
- return query;
- }
- }
- }
|