123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using EMIS.ViewModel.EducationManage;
- using System.Linq.Expressions;
- using EMIS.Entities;
- using EMIS.DataLogic.Repositories;
- using EMIS.ViewModel.EducationManagement;
- namespace EMIS.DataLogic.EducationManage
- {
- public class EducationMissionClassCheckDAL
- {
- public EducationMissionClassCheckRepository educationMissionClassCheckRepository { get; set; }
- public EducationMissionClassRepository educationMissionClassRepository { get; set; }
- public EducationMissionRepository educationMissionRepository { get; set; }
- public EducationMissionClassTeachingSettingRepository educationMissionClassTeachingSettingRepository { get; set; }
- public EducationSchedulingRepository educationSchedulingRepository { get; set; }
- public EducationSchedulingClassRepository educationSchedulingClassRepository { get; set; }
- public EducationSchedulingWeekNumRepository educationSchedulingWeekNumRepository { get; set; }
- public CoursesTimeRepository coursesTimeRepository { get; set; }
- public ClassroomRepository classroomRepository { get; set; }
- public SchoolyearRepository schoolyearRepository { get; set; }
- public MissionClassTeacherRepository missionClassTeacherRepository { get; set; }
- public CoursematerialRepository coursematerialRepository { get; set; }
- public StaffRepository staffRepository { get; set; }
- public UserRepository userRepository { get; set; }
- public IQueryable<EducationMissionClassCheckView> GetEducationMissionClassCheckViewQueryble(Expression<Func<EM_EducationMissionClassCheck, bool>> emccexp, Expression<Func<EM_EducationMission, bool>> emexp,
- Expression<Func<ES_EducationScheduling, bool>> esexp, Expression<Func<EM_MissionClassTeacher, bool>> mctexp, Expression<Func<EM_EducationMissionClass, bool>> emcexp,
- Expression<Func<ES_EducationSchedulingWeekNum, bool>> eswnexp)
- {
- var query = from edmcc in educationMissionClassCheckRepository.GetList(emccexp)
- join eswnr in educationSchedulingWeekNumRepository.GetList(eswnexp)
- on edmcc.EducationSchedulingWeekNumID equals eswnr.EducationSchedulingWeekNumID
- join esr in educationSchedulingRepository.GetList(esexp)
- on eswnr.EducationSchedulingID equals esr.EducationSchedulingID
- join escr in educationSchedulingClassRepository.Entities
- on esr.EducationSchedulingClassID equals escr.EducationSchedulingClassID
- join emcr in educationMissionClassRepository.GetList(emcexp)
- on escr.EducationMissionClassID equals emcr.EducationMissionClassID
- join cou in coursematerialRepository.Entities
- on emcr.CoursematerialID equals cou.CoursematerialID
- join emr in educationMissionRepository.GetList(emexp)
- on emcr.EducationMissionID equals emr.EducationMissionID
- join sch in schoolyearRepository.Entities
- on emr.SchoolyearID equals sch.SchoolyearID
- join ctr in coursesTimeRepository.Entities
- on esr.CoursesTimeID equals ctr.CoursesTimeID
- join cr in classroomRepository.Entities
- on esr.ClassroomID equals cr.ClassroomID
- select new EducationMissionClassCheckView
- {
- EducationMissionClassCheckID = edmcc.EducationMissionClassCheckID,
- EducationSchedulingWeekNumID = edmcc.EducationSchedulingWeekNumID,
- EducationMissionClassID = emcr.EducationMissionClassID,
- EducationSchedulingID = esr.EducationSchedulingID,
- EducationMissionClassName = emcr.Name,
- CoursematerialID = cou.CoursematerialID,
- CourseName = cou.CourseName,
- CollegeID = emr.CollegeID,
- WeekNum = eswnr.WeekNum,
- Weekday = esr.Weekday,
- CoursesTimeID = esr.CoursesTimeID,
- StartTimes = ctr.StartTimes,
- EndTimes = ctr.EndTimes,
- ClassroomID = esr.ClassroomID,
- ClassroomName = cr.Name,
- ClassroomCode = cr.Code,
- SchoolyearID = emr.SchoolyearID,
- SchoolyearCode = sch.Code,
- StudentComment = edmcc.StudentComment,
- TeacherComment = edmcc.TeacherComment,
- DeviceComment = edmcc.DeviceComment,
- CheckWayID = edmcc.CheckWayID,
- OpinionID = edmcc.OpinionID,
- Sys_User = edmcc.Sys_User,
- Remark = edmcc.Remark
- };
- return query;
- }
- public EducationMissionClassCheckView GetEducationMissionClassCheckView(Guid? educationMissionClassCheckID)
- {
- var query = from edmcc in educationMissionClassCheckRepository.GetList(x => x.EducationMissionClassCheckID == educationMissionClassCheckID)
- join eswnr in educationSchedulingWeekNumRepository.Entities
- on edmcc.EducationSchedulingWeekNumID equals eswnr.EducationSchedulingWeekNumID
- join esr in educationSchedulingRepository.Entities
- on eswnr.EducationSchedulingID equals esr.EducationSchedulingID
- join escr in educationSchedulingClassRepository.Entities
- on esr.EducationSchedulingClassID equals escr.EducationSchedulingClassID
- join emcr in educationMissionClassRepository.Entities
- on escr.EducationMissionClassID equals emcr.EducationMissionClassID
- join mctr in missionClassTeacherRepository.Entities
- on emcr.EducationMissionClassID equals mctr.MissionClassID
- join emr in educationMissionRepository.Entities
- on emcr.EducationMissionID equals emr.EducationMissionID
- join sch in schoolyearRepository.Entities
- on emr.SchoolyearID equals sch.SchoolyearID
- join ctr in coursesTimeRepository.Entities
- on esr.CoursesTimeID equals ctr.CoursesTimeID
- join cr in classroomRepository.Entities
- on esr.ClassroomID equals cr.ClassroomID
- select new EducationMissionClassCheckView
- {
- EducationMissionClassCheckID = edmcc.EducationMissionClassCheckID,
- EducationSchedulingWeekNumID = edmcc.EducationSchedulingWeekNumID,
- EducationMissionClassID = emcr.EducationMissionClassID,
- EducationSchedulingID = esr.EducationSchedulingID,
- WeekNum = eswnr.WeekNum,
- Weekday = esr.Weekday,
- CoursesTimeID = esr.CoursesTimeID,
- StartTimes = ctr.StartTimes,
- EndTimes = ctr.EndTimes,
- ClassroomID = esr.ClassroomID,
- ClassroomName = cr.Name,
- ClassroomCode = cr.Code,
- SchoolyearID = emr.SchoolyearID,
- SchoolyearCode = sch.Code,
- StudentComment = edmcc.StudentComment,
- TeacherComment = edmcc.TeacherComment,
- DeviceComment = edmcc.DeviceComment,
- CheckWayID = edmcc.CheckWayID,
- OpinionID = edmcc.OpinionID,
- Remark = edmcc.Remark
- };
- return query.ToList().FirstOrDefault();
- }
- public List<MissionClassTeacherView> GetTeacherByEducationSchedulingID(Expression<Func<ES_EducationScheduling, bool>> exp)
- {
- var query = from ec in educationSchedulingRepository.GetList(exp)
- from tea in ec.ES_EducationSchedulingTeacher
- select new MissionClassTeacherView
- {
- UserID = tea.CF_Staff.UserID,
- EducationSchedulingID = ec.EducationSchedulingID,
- EducationMissionClassID = ec.EM_EducationSchedulingClass.EducationMissionClassID,
- Name = tea.CF_Staff.Sys_User.Name,
- TeachingMethod = tea.TeachingMethod
- };
- return query.OrderBy(x => x.TeachingMethod).ToList();
- }
- public List<MissionClassTeacherView> GetTeacherNameQuery(Expression<Func<ES_EducationScheduling, bool>> exp, Expression<Func<ES_EducationSchedulingWeekNum, bool>> eswnexp)
- {
- var query = from ec in educationSchedulingRepository.GetList(exp)
- join eswn in educationSchedulingWeekNumRepository.GetList(eswnexp)
- on ec.EducationSchedulingID equals eswn.EducationSchedulingID
- from tea in ec.ES_EducationSchedulingTeacher
- select new MissionClassTeacherView
- {
- UserID = tea.CF_Staff.UserID,
- EducationSchedulingID = ec.EducationSchedulingID,
- EducationMissionClassID = ec.EM_EducationSchedulingClass.EducationMissionClassID,
- Name = tea.CF_Staff.Sys_User.Name,
- TeachingMethod = tea.TeachingMethod
- };
- return query.OrderBy(x => x.TeachingMethod).ToList();
- }
- public List<MissionClassTeacherView> GetMissionClassTeacherQuery(Expression<Func<EM_EducationMissionClass, bool>> exp)
- {
- var query = (from emc in educationMissionClassRepository.GetList(exp)
- from tec in emc.EM_MissionClassTeacher
- select new MissionClassTeacherView
- {
- UserID = tec.CF_Staff.UserID,
- EducationMissionClassID = emc.EducationMissionClassID,
- Name = tec.CF_Staff.Sys_User.Name,
- TeachingMethod = tec.TeachType
- });
- return query.OrderBy(x => x.EducationMissionClassID).OrderBy(x => x.TeachingMethod).ToList();
- }
- public IQueryable<EducationMissionClassView> GetEducationMissionClassViewByConditionQueryble(Expression<Func<EM_EducationMissionClass, bool>> emcexp, Expression<Func<EM_EducationMission, bool>> emexp, Expression<Func<ES_EducationSchedulingWeekNum, bool>> eswnexp, Expression<Func<ES_EducationScheduling, bool>> esexp)
- {
- var query = from emsr in educationMissionClassRepository.GetList(emcexp)
- join emr in educationMissionRepository.GetList(emexp)
- on emsr.EducationMissionID equals emr.EducationMissionID
- join cour in coursematerialRepository.Entities
- on emsr.CoursematerialID equals cour.CoursematerialID
- join escr in educationSchedulingClassRepository.Entities
- on emsr.EducationMissionClassID equals escr.EducationMissionClassID
- join esr in educationSchedulingRepository.GetList(esexp)
- on escr.EducationSchedulingClassID equals esr.EducationSchedulingClassID
- join eswnr in educationSchedulingWeekNumRepository.GetList(eswnexp)
- on esr.EducationSchedulingID equals eswnr.EducationSchedulingID
- select new EducationMissionClassView
- {
- EducationMissionClassID = emsr.EducationMissionClassID,
- CoursematerialID = emsr.CoursematerialID,
- CourseName = cour.CourseName,
- Name = emsr.Name,
- };
- return query;
- }
- public Guid GetEducationSchedulingWeekNumID(int? weekNum, int? weekDay, Guid? coursesTimeID, Guid? classroomID, Guid educationMissionClassID)
- {
- var query = from escr in educationSchedulingClassRepository.GetList(x => x.EducationMissionClassID == educationMissionClassID)
- join esr in educationSchedulingRepository.GetList(x => x.CoursesTimeID == coursesTimeID && x.Weekday == weekDay && x.ClassroomID == classroomID)
- on escr.EducationSchedulingClassID equals esr.EducationSchedulingClassID
- join eswnr in educationSchedulingWeekNumRepository.GetList(x => x.WeekNum == weekNum)
- on esr.EducationSchedulingID equals eswnr.EducationSchedulingID
- select new
- {
- EducationSchedulingWeekNumID = eswnr.EducationSchedulingWeekNumID,
- };
- return query.Select(x => x.EducationSchedulingWeekNumID).FirstOrDefault();
- }
- /// <summary>
- /// 获取教学检查检查人员
- /// </summary>
- /// <param name="educationMissionClassID"></param>
- /// <returns></returns>
- public IQueryable<EducationMissionClassCheckTeacherView> GetEducationMissionClassCheckTeacherListViewQueryble(Guid educationMissionClassCheckID)
- {
- var query = from emcc in educationMissionClassCheckRepository.GetList(x => x.EducationMissionClassCheckID == educationMissionClassCheckID)
- from staff in emcc.Sys_User
- select new EducationMissionClassCheckTeacherView
- {
- CheckTeacherID = staff.UserID,
- EducationMissionClassCheckID = emcc.EducationMissionClassCheckID,
- UserID = staff.CF_Staff.UserID,
- LoginID = staff.CF_Staff.Sys_User.LoginID,
- Name = staff.CF_Staff.Sys_User.Name,
- CollegeID = staff.CF_Staff.CF_College.CollegeID,
- CollegeName = staff.CF_Staff.CF_College.Name,
- Sex = staff.CF_Staff.SexID,
- DepartmentID = staff.CF_Staff.DepartmentID,
- DepartmentName = staff.CF_Staff.CF_Department.Name,
- BirthDate = staff.CF_Staff.BirthDate,
- TeacherType = staff.CF_Staff.TeacherTypeID,
- IncumbencyState = staff.CF_Staff.IncumbencyState,
- Title = staff.CF_Staff.TitleID,
- };
- return query;
- }
- }
- }
|