123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Linq.Expressions;
- using EMIS.Entities;
- using EMIS.ViewModel;
- using EMIS.ViewModel.CultureplanManage;
- using EMIS.ViewModel.CultureplanManage.PlanManagement;
- using EMIS.DataLogic.Repositories;
- using EMIS.DataLogic.Common.Cultureplan;
- namespace EMIS.DataLogic.CultureplanManage.PlanManagement
- {
- public class SpecialtyCourseDAL
- {
- public SpecialtyCourseRepository SpecialtyCourseRepository { get; set; }
- public SpecialtyCourseTeachingSettingRepository SpecialtyCourseTeachingSettingRepository { get; set; }
- public TeachingModeTypeRepository TeachingModeTypeRepository { get; set; }
- public TeachingPlaceRepository TeachingPlaceRepository { get; set; }
- public SpecialtyRepository SpecialtyRepository { get; set; }
- public CoursematerialRepository CoursematerialRepository { get; set; }
- public DepartmentRepository DepartmentRepository { get; set; }
- public CollegeRepository CollegeRepository { get; set; }
- public DictionaryItemRepository DictionaryItemRepository { get; set; }
- /// <summary>
- /// 查询对应的专业课程信息SpecialtyCourseView
- /// </summary>
- /// <param name="exp"></param>
- /// <returns></returns>
- public IQueryable<SpecialtyCourseView> GetSpecialtyCourseViewQueryable(Expression<Func<EM_SpecialtyCourse, bool>> exp)
- {
- var query = from sc in SpecialtyCourseRepository.GetList(exp)
- join spe in SpecialtyRepository.Entities
- on sc.SpecialtyID equals spe.SpecialtyID
- join dicst in DictionaryItemRepository.GetList(x => x.DictionaryCode == typeof(CF_Standard).Name)
- on spe.StandardID equals dicst.Value into tempst
- from spest in tempst.DefaultIfEmpty()
- join cou in CoursematerialRepository.Entities
- on sc.CoursematerialID equals cou.CoursematerialID
- join scts in SpecialtyCourseTeachingSettingRepository.Entities
- on sc.SpecialtyCourseID equals scts.SpecialtyCourseID into tempscts
- from scscts in tempscts.DefaultIfEmpty()
- join dep in DepartmentRepository.Entities
- on sc.DepartmentID equals dep.DepartmentID into tempdep
- from scdep in tempdep.DefaultIfEmpty()
- join col in CollegeRepository.Entities
- on scdep.CollegeID equals col.CollegeID into tempcol
- from sccol in tempcol.DefaultIfEmpty()
- select new SpecialtyCourseView
- {
- SpecialtyCourseID = sc.SpecialtyCourseID,
- SpecialtyID = sc.SpecialtyID,
- StandardID = spe.StandardID,
- StandardName = spest.Name,
- EducationID = spe.EducationID,
- LearningformID = spe.LearningformID,
- LearnSystem = spe.LearnSystem,
- StarttermID = sc.StarttermID,
- CoursematerialID = sc.CoursematerialID,
- CourseCode = cou.CourseCode,
- CourseName = cou.CourseName,
- CourseStructureID = sc.CourseStructureID,
- CourseCategoryID = sc.CourseCategoryID,
- CourseTypeID = sc.CourseTypeID,
- CourseQualityID = sc.CourseQualityID,
- Credit = scscts.Credit ?? 0,
- TheoryCourse = scscts.TheoryCourse ?? 0,
- Practicehours = scscts.Practicehours ?? 0,
- Trialhours = scscts.Trialhours ?? 0,
- Totalhours = (scscts.TheoryCourse ?? 0) + (scscts.Practicehours ?? 0),
- TheoryWeeklyNum = scscts.TheoryWeeklyNum ?? 0,
- PracticeWeeklyNum = scscts.PracticeWeeklyNum ?? 0,
- TrialWeeklyNum = scscts.TrialWeeklyNum ?? 0,
- SchoolweeksNum = (scscts.TheoryWeeklyNum ?? 0) + (scscts.PracticeWeeklyNum ?? 0),
- WeeklyHours = scscts.WeeklyHours ?? 0,
- WeeklyNum = scscts.WeeklyNum ?? 0,
- StartWeeklyNum = scscts.StartWeeklyNum ?? 0,
- EndWeeklyNum = scscts.EndWeeklyNum ?? 0,
- StartEndWeeklyNum = (scscts.StartWeeklyNum ?? 0) + "-" + (scscts.EndWeeklyNum ?? 0),
- DepartmentID = sc.DepartmentID,
- DepartmentCode = scdep.No,
- DepartmentName = scdep.Name,
- CollegeID = scdep.CollegeID,
- CollegeCode = sccol.No,
- CollegeName = sccol.Name,
- IsSpecialtycore = sc.IsSpecialtycore ?? false,
- IsCooperation = sc.IsCooperation ?? false,
- IsRequired = sc.IsRequired ?? false,
- IsElective = sc.IsElective ?? false,
- IsNetworkCourse = sc.IsNetworkCourse ?? false,
- IsMainCourse = sc.IsMainCourse ?? false,
- IsNeedMaterial = sc.IsNeedMaterial ?? false,
- CourseFineID = sc.CourseFineID,
- PracticeTypeID = sc.PracticeTypeID,
- TeachinglanguageID = sc.TeachinglanguageID,
- ExaminationModeID = sc.ExaminationModeID,
- ResultTypeID = sc.ResultTypeID,
- HandleModeID = sc.HandleModeID,
- TeachingModeIDList = sc.EM_TeachingModeType.Select(x => x.TeachingModeID).ToList(),
- TeachingPlaceIDList = sc.EM_TeachingPlace.Select(x => x.TeachingPlace).ToList(),
- IsEnable = sc.IsEnable ?? false,
- Remark = sc.Remark,
- RecordStatus = sc.RecordStatus,
- CreateUserID = sc.CreateUserID,
- CreateTime = sc.CreateTime,
- ModifyUserID = sc.ModifyUserID,
- ModifyTime = sc.ModifyTime
- };
- return query;
- }
- /// <summary>
- /// 查询专业课程信息对应的授课方式
- /// </summary>
- /// <param name="exp"></param>
- /// <returns></returns>
- public IQueryable<int?> GetTeachingModeTypeQueryble(Expression<Func<EM_SpecialtyCourse, bool>> exp)
- {
- var query = from sc in SpecialtyCourseRepository.GetList(exp)
- join tm in TeachingModeTypeRepository.Entities
- on sc.SpecialtyCourseID equals tm.SpecialtyCourseID
- join dictm in DictionaryItemRepository.GetList(x => x.DictionaryCode == typeof(CF_TeachingMode).Name)
- on tm.TeachingModeID equals dictm.Value
- select dictm.Value;
- return query;
- }
- /// <summary>
- /// 查询专业课程信息对应的授课地点
- /// </summary>
- /// <param name="exp"></param>
- /// <returns></returns>
- public IQueryable<int?> GetTeachingPlaceQueryble(Expression<Func<EM_SpecialtyCourse, bool>> exp)
- {
- var query = from sc in SpecialtyCourseRepository.GetList(exp)
- join tp in TeachingPlaceRepository.Entities
- on sc.SpecialtyCourseID equals tp.SpecialtyCourseID
- join dictp in DictionaryItemRepository.GetList(x => x.DictionaryCode == typeof(EMIS.ViewModel.EM_TeachingPlace).Name)
- on tp.TeachingPlace equals dictp.Value
- select dictp.Value;
- return query;
- }
- }
- }
|