using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Text; using EMIS.DataLogic.Repositories; using EMIS.Entities; using EMIS.ViewModel.StudentManage.StudentProfile; namespace EMIS.DataLogic.StudentManage.StudentProfile { public class StudentPunishDAL { public StudentPunishRepository StudentPunishRepository { get; set; } public SchoolyearRepository SchoolyearRepository { get; set; } public StudentRepository StudentRepository { get; set; } public ClassmajorRepository ClassmajorRepository { get; set; } public GrademajorRepository GrademajorRepository { get; set; } public FacultymajorRepository FacultymajorRepository { get; set; } public CollegeRepository CollegeRepository { get; set; } public CampusRepository CampusRepository { get; set; } public UserRepository UserRepository { get; set; } /// /// 查询对应的学生处分信息StudentPunishView /// /// /// public IQueryable GetStudentPunishViewQueryable(Expression> expStudentPunish) { var query = from stuph in StudentPunishRepository.GetList(expStudentPunish) join sy in SchoolyearRepository.Entities on stuph.SchoolyearID equals sy.SchoolyearID join stu in StudentRepository.Entities on stuph.UserID equals stu.UserID join cl in ClassmajorRepository.Entities on stu.ClassmajorID equals cl.ClassmajorID join gr in GrademajorRepository.Entities on cl.GrademajorID equals gr.GrademajorID join fa in FacultymajorRepository.Entities on gr.FacultymajorID equals fa.FacultymajorID join col in CollegeRepository.Entities on fa.CollegeID equals col.CollegeID join cam in CampusRepository.Entities on col.CampusID equals cam.CampusID join us in UserRepository.Entities on stu.UserID equals us.UserID select new StudentPunishView { StudentPunishID = stuph.StudentPunishID, SchoolyearID = stuph.SchoolyearID, SchoolyearValue = sy.Value, SchoolyearCode = sy.Code, UserID = stuph.UserID, StudentNo = us.LoginID, Name = us.Name, SexID = stu.SexID, BirthDate = stu.BirthDate, NationID = stu.NationID, PoliticsID = stu.PoliticsID, InSchoolStatusID = stu.InSchoolStatusID, StudentStatus = stu.StudentStatus, GradeID = gr.GradeID, StandardID = fa.StandardID, EducationID = fa.EducationID, LearningformID = fa.LearningformID, LearnSystem = fa.LearnSystem, ClassNum = cl.ClassNum, ClassmajorID = stu.ClassmajorID, ClassmajorNo = cl.No, ClassmajorName = cl.Name, GrademajorID = cl.GrademajorID, GrademajorCode = gr.Code, GrademajorName = gr.Name, FacultymajorID = gr.FacultymajorID, FacultymajorCode = fa.Code, FacultymajorName = fa.Name, CollegeID = fa.CollegeID, CollegeNo = col.No, CollegeName = col.Name, CampusID = col.CampusID, CampusCode = cam.No, CampusName = cam.Name, PunishTypeID = stuph.PunishTypeID, PunishLevelID = stuph.PunishLevelID, DocNo = stuph.DocNo, PunishDate = stuph.PunishDate, Reason = stuph.Reason, CancelDocNo = stuph.CancelDocNo, CancelDate = stuph.CancelDate, ApprovalStatus = stuph.ApprovalStatus, RecordStatus = stuph.RecordStatus, CreateUserID = stuph.CreateUserID, CreateTime = stuph.CreateTime, ModifyUserID = stuph.ModifyUserID, ModifyTime = stuph.ModifyTime }; return query; } /// /// 查询对应的学生处分信息StudentPunishView /// /// /// /// public IQueryable GetStudentPunishViewQueryable(Expression> expStudentPunish, Expression> expStudent) { var query = from stuph in StudentPunishRepository.GetList(expStudentPunish) join sy in SchoolyearRepository.Entities on stuph.SchoolyearID equals sy.SchoolyearID join stu in StudentRepository.GetList(expStudent) on stuph.UserID equals stu.UserID join cl in ClassmajorRepository.Entities on stu.ClassmajorID equals cl.ClassmajorID join gr in GrademajorRepository.Entities on cl.GrademajorID equals gr.GrademajorID join fa in FacultymajorRepository.Entities on gr.FacultymajorID equals fa.FacultymajorID join col in CollegeRepository.Entities on fa.CollegeID equals col.CollegeID join cam in CampusRepository.Entities on col.CampusID equals cam.CampusID join us in UserRepository.Entities on stu.UserID equals us.UserID select new StudentPunishView { StudentPunishID = stuph.StudentPunishID, SchoolyearID = stuph.SchoolyearID, SchoolyearValue = sy.Value, SchoolyearCode = sy.Code, UserID = stuph.UserID, StudentNo = us.LoginID, Name = us.Name, SexID = stu.SexID, BirthDate = stu.BirthDate, NationID = stu.NationID, PoliticsID = stu.PoliticsID, InSchoolStatusID = stu.InSchoolStatusID, StudentStatus = stu.StudentStatus, GradeID = gr.GradeID, StandardID = fa.StandardID, EducationID = fa.EducationID, LearningformID = fa.LearningformID, LearnSystem = fa.LearnSystem, ClassNum = cl.ClassNum, ClassmajorID = stu.ClassmajorID, ClassmajorNo = cl.No, ClassmajorName = cl.Name, GrademajorID = cl.GrademajorID, GrademajorCode = gr.Code, GrademajorName = gr.Name, FacultymajorID = gr.FacultymajorID, FacultymajorCode = fa.Code, FacultymajorName = fa.Name, CollegeID = fa.CollegeID, CollegeNo = col.No, CollegeName = col.Name, CampusID = col.CampusID, CampusCode = cam.No, CampusName = cam.Name, PunishTypeID = stuph.PunishTypeID, PunishLevelID = stuph.PunishLevelID, DocNo = stuph.DocNo, PunishDate = stuph.PunishDate, Reason = stuph.Reason, CancelDocNo = stuph.CancelDocNo, CancelDate = stuph.CancelDate, ApprovalStatus = stuph.ApprovalStatus, RecordStatus = stuph.RecordStatus, CreateUserID = stuph.CreateUserID, CreateTime = stuph.CreateTime, ModifyUserID = stuph.ModifyUserID, ModifyTime = stuph.ModifyTime }; return query; } } }