1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Linq.Expressions;
- using EMIS.DataLogic.Repositories;
- using EMIS.ViewModel.SystemView;
- using EMIS.Entities;
- using EMIS.ViewModel;
- namespace EMIS.DataLogic.SystemSetting
- {
- public class DictionaryItemDAL
- {
- public DictionaryItemRepository DictionaryItemRepository { get; set; }
- public DictionaryRepository DictionaryRepository { get; set; }
- /// <summary>
- /// 查询对应的数据字典信息View
- /// </summary>
- /// <param name="exp"></param>
- /// <returns></returns>
- public IQueryable<DictionaryItemView> GetDictionaryItemViewQueryable(Expression<Func<Sys_DictionaryItem, bool>> exp)
- {
- var query = from dicitem in DictionaryItemRepository.GetList(exp)
- join dic in DictionaryRepository.Entities
- on dicitem.DictionaryCode equals dic.DictionaryCode
- select new DictionaryItemView
- {
- DictionaryItemID = dicitem.DictionaryItemID,
- DictionaryCode = dicitem.DictionaryCode,
- DictionaryName = dic.Name,
- OrderNo = dicitem.OrderNo,
- Code = dicitem.Code,
- Name = dicitem.Name,
- Value = dicitem.Value,
- IsEditable = dicitem.IsEditable == true ? true : false,
- IsVisible = dicitem.RecordStatus > (int)SYS_STATUS.UNUSABLE ? true : false,
- RecordStatus = dicitem.RecordStatus
- };
- return query;
- }
- }
- }
|