123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using EMIS.DataLogic.Repositories;
- using System.Linq.Expressions;
- using EMIS.Entities;
- using EMIS.ViewModel.CalendarManage;
- namespace EMIS.DataLogic.Common.CalendarManage
- {
- public class SCalendarDAL
- {
- public SCalendarRepository scalendarRepository { get; set; }
- public DictionaryItemRepository dictionaryItemRepository { get; set; }
-
- /// <summary>
- /// 读取校历信息
- /// </summary>
- /// <param name="exp"></param>
- /// <returns></returns>
- public IQueryable<SCalendarView> GetSCalendarQueryable(Expression<Func<CF_SCalendar, bool>> exp)
- {
- var query = from a in scalendarRepository.GetList(exp)
- join b in dictionaryItemRepository.Entities on new { a.ActivitiesType, DictionaryCode = "CF_ActivitiesType" }
- equals new { ActivitiesType = b.Value, b.DictionaryCode } into gbty
- from gicbty in gbty.DefaultIfEmpty()
- 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 SCalendarView
- {
- ActivitiesID = a.ActivitiesID,
- Name = a.Name,
- ActivitiesTime = a.ActivitiesTime,
- TimesSegment = a.TimesSegment,
- TimesSegmentName = gicbsta.Name,
- ActivitiesContent = a.ActivitiesContent,
- ActivitiesType = a.ActivitiesType,
- ActivitiesTypeName = gicbty.Name,
- CreateUserID = a.CreateUserID,
- CreateTime = a.CreateTime
- };
- return query;
- }
- }
- }
|