using System; using System.Collections.Generic; using System.Linq; using System.Text; using EMIS.ViewModel.ExaminationApply; using EMIS.DataLogic.Repositories; using System.Linq.Expressions; using EMIS.Entities; namespace EMIS.DataLogic.ExaminationApply { public class ExaminationTypeDAL { public ExaminationTypeRepository ExaminationTypeRepository { get; set; } public ExaminationBatchProjectRepository ExaminationBatchProjectRepository { get; set; } public IQueryable GetExaminationTypeView(Expression> examinationTypeExpression) { var q = (from et in ExaminationTypeRepository.GetList(examinationTypeExpression) orderby et.Name select new ExaminationTypeView { ExaminationTypeID = et.ExaminationTypeID, Name = et.Name, IsTimesLimit = et.IsTimesLimit ?? false, RecordStatus = et.RecordStatus, CreateUserID = et.CreateUserID, CreateTime = et.CreateTime, ModifyUserID = et.ModifyUserID, ModifyTime = et.ModifyTime }); return q; } public IQueryable GetExaminationTypeViewBySchoolyearID(Expression> ebpexp) { var query = from ebpr in ExaminationBatchProjectRepository.Entities.Where(ebpexp) from et in ExaminationTypeRepository.Entities.Where(x => x.ExaminationTypeID == ebpr.EX_ExaminationProject.ExaminationTypeID) select new ExaminationTypeView { ExaminationTypeID = et.ExaminationTypeID, Name = et.Name, IsTimesLimit = et.IsTimesLimit ?? false, RecordStatus = et.RecordStatus, CreateUserID = et.CreateUserID, CreateTime = et.CreateTime, ModifyUserID = et.ModifyUserID, ModifyTime = et.ModifyTime }; return query; } } }