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 ExamPersonControlDAL { public ExaminationBatchProjectPersonControlRepository PersonControlRepository { get; set; } public ExaminationBatchProjectRepository BatchProjectRepository { get; set; } public DictionaryItemRepository DictionaryItemRepository { get; set; } public ExaminationTypeRepository TypeRepository { get; set; } public StudentRepository StudentRepository { get; set; } public IQueryable GetList(Expression> expCampus) { var query = from a in PersonControlRepository.GetList(expCampus) join b in BatchProjectRepository.Entities on a.ExaminationBatchProjectID equals b.ExaminationBatchProjectID join c in StudentRepository.Entities on a.UserID equals c.UserID select new EMIS.ViewModel.ExamPersonControlView { Schoolyear = b.EX_ExaminationBatch.CF_Schoolyear.Code, SchoolYearCode = b.EX_ExaminationBatch.CF_Schoolyear.SchoolyearID, ExaminationBatchID = b.ExaminationBatchID, ExaminationBatchProject = a.EX_ExaminationBatchProject.EX_ExaminationBatch.Name, ExaminationProjectFee = a.EX_ExaminationProjectFee.Name, StartDate = a.StartDate, ExaminationBatchProjectID = a.ExaminationBatchProjectID, ExaminationProjectFeeID = a.ExaminationProjectFeeID, IsOnlinePayName = (a.IsOnlinePay == true ? "是" : "否"), ExaminationTypeID = b.EX_ExaminationProject.ExaminationTypeID, EndDate = a.EndDate, ExaminationBatchProjectPersonControlID = a.ExaminationBatchProjectPersonControlID, IsOnlinePay = a.IsOnlinePay, UserID = a.UserID, ExaminationProjectID = b.ExaminationProjectID, ProjectName = b.EX_ExaminationProject.Name, ExaminationType = b.EX_ExaminationProject.EX_ExaminationType.Name, CollegeID = c.CF_Classmajor.CF_Grademajor.CF_Facultymajor.CollegeID, UserName = c.Sys_User.Name, Sex = c.Sex, IDNumber = c.IDNumber, ClassmajorName = c.CF_Classmajor.Name, ClassmajorID = c.ClassmajorID, GrademajorName = c.CF_Classmajor.CF_Grademajor.Name, CollegeName = c.CF_Classmajor.CF_Grademajor.CF_Facultymajor.CF_College.Name, Years = c.CF_Classmajor.CF_Grademajor.SchoolyearID.ToString(), StandardID = c.CF_Classmajor.CF_Grademajor.CF_Facultymajor.StandardID, }; return query; } } }