1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- 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 ActivitieDAL
- {
- public ActivitiesSetsRepository activitiesSetsRepository { get; set; }
- public DictionaryItemRepository dictionaryItemRepository { get; set; }
-
- /// <summary>
- /// 读取固定活动信息
- /// </summary>
- /// <param name="exp"></param>
- /// <returns></returns>
- public IQueryable<ActivitieView> GetActivitiesQueryable(Expression<Func<CF_ActivitiesSets, bool>> exp)
- {
- var query = from a in activitiesSetsRepository.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 ActivitieView
- {
- ActivitiesID = a.ActivitiesID,
- Name = a.Name,
- ActivitiesTime = a.ActivitiesTimeMonth+"-"+a.ActivitiesTimeDay,
- ActivitiesTimeMonth=a.ActivitiesTimeMonth,
- ActivitiesTimeDay=a.ActivitiesTimeDay,
- TimesSegment = a.TimesSegment,
- TimesSegmentName = gicbsta.Name,
- ActivitiesContent = a.ActivitiesContent,
- ActivitiesType = a.ActivitiesType,
- ActivitiesTypeName = gicbty.Name,
- CreateUserID = a.CreateUserID,
- CreateTime = a.CreateTime
- };
- return query;
- }
- }
- }
|