using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EMIS.ViewModel.SystemView;
using EMIS.Entities;
using System.Linq.Expressions;
using EMIS.DataLogic.Repositories;
using EMIS.ViewModel.TeacherManagement;
using EMIS.ViewModel.Students;
namespace EMIS.DataLogic.Common.Students
{
public class InSchoolStatusSettingDAL
{
public DictionaryItemRepository dictionaryItemView { get; set; }
public InSchoolSettingRepository inSchoolSettingRepository { get; set; }
///
/// 查询字典元素信息
///
///
///
public IQueryable GetdicViewQueryable(Expression> exp)
{
var query = from a in dictionaryItemView.GetList(exp)
join b in inSchoolSettingRepository.Entities on a.Value equals b.InSchoolStatusID into gsp
from gisp in gsp.DefaultIfEmpty()
select new InSchoolStatusView
{
DictionaryItemID = a.DictionaryItemID,
Code = a.Code,
DictionaryCode = a.DictionaryCode,
Value = a.Value,
Name = a.Name,
OrderNo = a.OrderNo,
Sys_RecordStatus = a.RecordStatus,
IsEditable = a.IsEditable,
InSchoolSettingID = gisp.InSchoolSettingID,
InSchoolStatusID = gisp.InSchoolStatusID,
IsSelected = gisp.IsSelected == true ? true : false,
RecordStatus = gisp.RecordStatus,
CreateTime = gisp.CreateTime,
CreateUserID = gisp.CreateUserID,
ModifyTime = gisp.ModifyTime,
ModifyUserID = gisp.ModifyUserID
};
return query;
}
}
}