1234567891011121314151617181920212223242526272829303132333435363738394041 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Data.Entity;
- using System.Text;
- using EMIS.DataLogic.Repositories;
- using EMIS.Entities;
- using System.Linq.Expressions;
- using EMIS.ViewModel;
- namespace EMIS.DataLogic.SystemSetting
- {
- public class ControlItemDAL
- {
- public ControlItemRepository ControlItemRepository { get; set; }
- public ControlItemDetailRepository ControlItemDetailRepository { get; set; }
- public DictionaryItemRepository DictionaryItemRepository { get; set; }
- public IQueryable<Sys_ControlItem> GetControlItemList(Expression<Func<Sys_ControlItem, bool>> exp)
- {
- var query = (from ci in ControlItemRepository.GetList(exp)
- join dcit in DictionaryItemRepository.GetList(x => x.DictionaryCode == typeof(SYS_ControlItemType).Name)
- on ci.ControlItemTypeID equals dcit.Value
- orderby dcit.OrderNo
- select ci).Include(x => x.Sys_ControlItemDetail);
- return query;
- }
- public IQueryable<Sys_ControlItemDetail> GetControlItemDetailList(Expression<Func<Sys_ControlItemDetail, bool>> exp)
- {
- var query = (from ci in ControlItemDetailRepository.GetList(exp)
- join dcit in DictionaryItemRepository.GetList(x => x.DictionaryCode == typeof(SYS_ControlItemType).Name)
- on ci.Sys_ControlItem.ControlItemTypeID equals dcit.Value
- orderby dcit.OrderNo
- select ci).Include(x => x.Sys_ControlItem);
- return query;
- }
- }
- }
|