12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using EMIS.DataLogic.Repositories;
- using EMIS.ViewModel.SchedulingManage.SchedulingSettings;
- using System.Linq.Expressions;
- using EMIS.ViewModel.CalendarManage;
- using EMIS.Entities;
- namespace EMIS.DataLogic.SchedulingManage.SchedulingSettings
- {
- public class CourseTimeHoursDAL
- {
- public CoursesTimeRepository coursesTimeRepository { get; set; }
- public DictionaryItemRepository dictionaryItemRepository { get; set; }
- public CourseTimeHoursRepository courseTimeHoursRepository { get; set; }
- /// <summary>
- /// 读取课程课时类别信息
- /// </summary>
- /// <param name="exp"></param>
- /// <returns></returns>
- public IQueryable<CourseTimeHoursView> GetCoursesTimeQueryable(Expression<Func<EM_CoursesTime, bool>> exp, Expression<Func<TP_CourseTimeHours, bool>> exps)
- {
- var query = from a in coursesTimeRepository.GetList(exp)
- join b in courseTimeHoursRepository.GetList(exps) on a.CoursesTimeID equals b.CoursesTimeID
- join c in dictionaryItemRepository.Entities on new { a.TimesSegment, DictionaryCode = "CF_TimesSegment" }
- equals new { TimesSegment = c.Value.Value, c.DictionaryCode } into gbsta
- from gicbsta in gbsta.DefaultIfEmpty()
- select new CourseTimeHoursView
- {
- CoursesTimeID = a.CoursesTimeID,
- StartTimes = a.StartTimes,
- EndTimes = a.EndTimes,
- TimesSegment = a.TimesSegment,
- TimesSegmentName = gicbsta.Name,
- StartHour = a.StartHour,
- StartMinutes = a.StartMinutes,
- EndHour = a.EndHour,
- EndMinutes = a.EndMinutes,
- CourseTimeHoursID=b.CourseTimeHoursID,
- Year = b.Years,
- Hours=b.Hours
- };
- return query;
-
- }
- }
- }
|