using System; using System.Collections.Generic; using System.Linq; using System.Text; using EMIS.DataLogic.Repositories; using System.Linq.Expressions; using EMIS.Entities; namespace EMIS.DataLogic.ExamManage { public class ExamProjectControlDAL { public ExaminationBatchProjectControlRepository ProjectControlRepository { get; set; } public ExaminationBatchProjectRepository BatchProjectRepository { get; set; } public DictionaryItemRepository DictionaryItemRepository { get; set; } public ExaminationTypeRepository TypeRepository { get; set; } public IQueryable GetList(Expression> expCampus) { var query = from a in ProjectControlRepository.GetList(expCampus) join b in BatchProjectRepository.Entities on a.ExaminationBatchProjectID equals b.ExaminationBatchProjectID select new EMIS.ViewModel.ExamProjectControlView { Schoolyear = b.EX_ExaminationBatch.CF_Schoolyear.Code, SchoolYearCode = b.EX_ExaminationBatch.CF_Schoolyear.SchoolyearID, ProjectName = b.EX_ExaminationProject.Name, StandardID = a.StandardID, SchoolyearNumID = a.SchoolyearID, ExaminationType = b.EX_ExaminationProject.EX_ExaminationType.Name, IsOnlinePay = a.IsOnlinePay, CollegeName = a.CF_College.Name, ExaminationBatchProject = a.EX_ExaminationBatchProject.EX_ExaminationBatch.Name, ExaminationProjectFee = a.EX_ExaminationProjectFee.Name, ExaminationBatchProjectID = a.ExaminationBatchProjectID, CollegeID = a.CollegeID, SchoolyearID = a.SchoolyearID, ExaminationBatchID = b.ExaminationBatchID, ExaminationProjectID = b.ExaminationProjectID, ExaminationProjectFeeID = a.ExaminationProjectFeeID, ExaminationBatchProjectControlID = a.ExaminationBatchProjectControlID, IsOnlinePayName = (a.IsOnlinePay == true ? "是" : "否"), ExaminationTypeID = b.EX_ExaminationProject.ExaminationTypeID, Name = b.EX_ExaminationProject.Name, }; return query; } } }