123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using EMIS.ViewModel.MinorManage.MinorCourseManage;
- using System.Linq.Expressions;
- using EMIS.Entities;
- using EMIS.DataLogic.Repositories;
- using EMIS.ViewModel;
- namespace EMIS.DataLogic.MinorManage.MinorCourseManage
- {
- public class MinorSpecialtyCourseDAL
- {
- public MinorCourseRepository MinorCourseRepository { get; set; }
- public MinorCourseTeachingSettingRepository MinorCourseTeachingSettingRepository { get; set; }
- public MinorCourseTeachingModeTypeRepository MinorCourseTeachingModeTypeRepository { get; set; }
- public MinorCourseTeachingPlaceRepository MinorCourseTeachingPlaceRepository { get; set; }
- public DictionaryItemRepository DictionaryItemRepository { get; set; }
- /// <summary>
- /// 查询专业计划
- /// </summary>
- /// <param name="exp"></param>
- /// <returns></returns>
- public IQueryable<MinorSpecialtyCourseView> GetMinorSpecialtyCourseViewQueryable(Expression<Func<EM_MinorCourse, bool>> exp)
- {
- var query = from a in MinorCourseRepository.GetList(exp)
- select new MinorSpecialtyCourseView
- {
- MinorCourseID=a.MinorCourseID,
- DepartmentID = a.DepartmentID,
- DepartmentName = a.CF_Department.Name,
- IsEnable = a.IsEnable ?? true,
- CollegeID=a.CF_Department.CF_College.CollegeID,
- StandardID = a.StandardID,
- CoursematerialID = a.EM_Coursematerial.CoursematerialID,
- CourseCode = a.EM_Coursematerial.CourseCode,
- CourseName = a.EM_Coursematerial.CourseName,
- CourseStructureID = a.CourseStructureID,
- CourseCategoryID = a.CourseCategoryID,
- CourseTypeID = a.CourseTypeID,
- CourseQualityID = a.CourseQualityID,
- PracticeTypeID = a.PracticeTypeID,
- ExaminationModeID = a.ExaminationModeID,
- TeachinglanguageID = a.TeachinglanguageID,
- SchoolyearNumID = a.SchoolyearNumID,
- SchoolcodeID = a.SchoolcodeID,
- //StarttermID = a.CF_Schoolyear.Value - ((a.CF_Grademajor.SchoolyearID * 2 - 1) + a.CF_Grademajor.SchoolcodeID - 1) + 1,
- CourseFineID = a.CourseFineID,
- IsSpecialtycore = a.IsSpecialtycore ?? true,
- IsCooperation = a.IsCooperation ?? true,
- IsRequired = a.IsRequired ?? true,
- IsElective = a.IsElective ?? true,
- IsNetworkCourse = a.IsNetworkCourse ?? true,
- IsMainCourse = a.IsMainCourse ?? true,
- Credit = a.EM_MinorCourseTeachingSetting.Credit,
- TheoryCourse = a.EM_MinorCourseTeachingSetting.TheoryCourse,
- Practicehours = a.EM_MinorCourseTeachingSetting.Practicehours,
- Trialhours = a.EM_MinorCourseTeachingSetting.Trialhours,
- Totalhours=a.EM_MinorCourseTeachingSetting.TheoryCourse+a.EM_MinorCourseTeachingSetting.Practicehours+a.EM_MinorCourseTeachingSetting.Trialhours,
- WeeklyNum = a.EM_MinorCourseTeachingSetting.WeeklyNum,
- TheoryWeeklyNum = a.EM_MinorCourseTeachingSetting.TheoryWeeklyNum,
- PracticeWeeklyNum = a.EM_MinorCourseTeachingSetting.PracticeWeeklyNum,
- TrialWeeklyNum = a.EM_MinorCourseTeachingSetting.TrialWeeklyNum,
- StartWeeklyNum = a.EM_MinorCourseTeachingSetting.StartWeeklyNum,
- WeeklyHours = a.EM_MinorCourseTeachingSetting.WeeklyHours,
- EndWeeklyNum = a.EM_MinorCourseTeachingSetting.EndWeeklyNum,
- CreateUserID = a.CreateUserID,
- CreateTime = a.CreateTime,
- ResultTypeID = a.ResultTypeID,
- Remarks = a.Remarks,
- };
- return query;
- }
- /// <summary>
- /// 根据辅修专业课程获取授课方式
- /// </summary>
- /// <param name="specialtyCourseID"></param>
- /// <returns></returns>
- public List<string> GetTeachingModeTypeQueryble(Guid? MinorCourseID)
- {
- var query = from a in MinorCourseTeachingModeTypeRepository.Entities.Where(x => x.MinorCourseID == MinorCourseID)
- join b in DictionaryItemRepository.Entities on new { a.TeachingModeID, DictionaryCode = DictionaryItem.CF_TeachingMode.ToString() }
- equals new { TeachingModeID = b.Value, b.DictionaryCode }
- select b.Value.Value.ToString();
- return query.ToList();
- }
- /// <summary>
- /// 根据辅修专业课程获取授课地点
- /// </summary>
- /// <param name="specialtyCourseID"></param>
- /// <returns></returns>
- public List<string> GetTeachingPlaceQueryble(Guid? MinorCourseID)
- {
- var query = from a in MinorCourseTeachingPlaceRepository.Entities.Where(x => x.MinorCourseID == MinorCourseID)
- join b in DictionaryItemRepository.Entities on new { a.TeachingPlace, DictionaryCode = DictionaryItem.EM_TeachingPlace.ToString() }
- equals new { TeachingPlace = b.Value, b.DictionaryCode }
- select b.Value.Value.ToString();
- return query.ToList();
- }
- }
- }
|