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; }
///
/// 查询对应的数据字典信息View
///
///
///
public IQueryable GetDictionaryItemViewQueryable(Expression> 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;
}
}
}