using System; using System.Collections.Generic; using EMIS.DataLogic.Repositories; using System.Linq; using System.Text; using EMIS.ViewModel.ScoreManage; using EMIS.Entities; using System.Linq.Expressions; namespace EMIS.DataLogic.ScoreManage { public class LevelSettingDAL { public LevelSettingRepository levelSettingRepository { get; set; } public ExaminationSubjectRepository examinationSubjectRepository { get; set; } public IQueryable GetLevelSettingViewQueryable(Expression> exp) { var query = from a in levelSettingRepository.GetList(exp) join b in examinationSubjectRepository.Entities on a.ExaminationSubjectID equals b.ExaminationSubjectID select new LevelSettingView { LevelSettingID = a.LevelSettingID, ExaminationSubjectID = a.ExaminationSubjectID, ExaminationSubjectName = b.Name, LevelNo = a.LevelNum.Value, LevelName = a.LevelName, MaxScore = a.MaxScore.Value, MinScore = a.MinScore.Value, ScoreRange = a.MinScore.ToString() + " <=总成绩<= " + a.MaxScore.ToString(), Remark = a.Remark }; return query; } } }