1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using EMIS.DataLogic.Repositories;
- using System.Linq.Expressions;
- using EMIS.ViewModel.GraduationManage.GraduationRequirement;
- using EMIS.Entities;
- namespace EMIS.DataLogic.GraduationManage.GraduationRequirement
- {
- public class GrademajorRequirementDAL
- {
- public GraduationRequirementRepository GraduationRequirementRepository { get; set; }
- public GrademajorRepository GrademajorRepository { get; set; }
- public FacultymajorRepository FacultymajorRepository { get; set; }
- public CollegeRepository CollegeRepository { get; set; }
- public SchoolyearRepository SchoolyearRepository { get; set; }
- /// <summary>
- /// 查询对应的毕业专业学分信息View
- /// </summary>
- /// <param name="exp"></param>
- /// <returns></returns>
- public IQueryable<GrademajorRequirementView> GetGradGrademajorRequirementQueryable(Expression<Func<ER_GraduationRequirement, bool>> exp)
- {
- var query = from gsr in GraduationRequirementRepository.GetList(exp)
- join gr in GrademajorRepository.Entities
- on gsr.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 sye in SchoolyearRepository.Entities
- on
- new { SchoolyearID = gr.GradeID.Value, SchoolcodeID = gr.SemesterID.Value }
- equals
- new { SchoolyearID = sye.Years, SchoolcodeID = sye.SchoolcodeID }
- into tempsyenter
- from syenter in tempsyenter.DefaultIfEmpty()
- select new GrademajorRequirementView
- {
- GraduationRequirementID = gsr.GraduationRequirementID,
- GrademajorID = gsr.GrademajorID,
- GrademajorCode = gr.Code,
- GrademajorName = gr.Name,
- FacultymajorID = gr.FacultymajorID,
- FacultymajorNo = fa.Code,
- FacultymajorName = fa.Name,
- CollegeID = fa.CollegeID,
- CollegeNo = col.No,
- CollegeName = col.Name,
- SchoolyearID = gr.GradeID,
- SchoolcodeID = gr.SemesterID,
- EnteringSchoolYearID = syenter.SchoolyearID,
- EnteringSchoolYearCode = syenter.Code,
- GraduatingSemesterID = gr.CF_Schoolyear.SchoolyearID,
- GraduatingSemesterCode = gr.CF_Schoolyear.Code,
- StandardID = fa.StandardID,
- EducationID = fa.EducationID,
- LearningformID = fa.LearningformID,
- LearnSystem = fa.LearnSystem,
- OptionalCourseCredit = gsr.OptionalCourseCredit,
- RequiredCredit = gsr.RequiredCredit,
- TotalCredit = gsr.TotalCredit,
- RecordStatus = gsr.RecordStatus,
- CreateUserID = gsr.CreateUserID,
- CreateTime = gsr.CreateTime,
- ModifyUserID = gsr.ModifyUserID,
- ModifyTime = gsr.ModifyTime
- };
- return query;
- }
- }
- }
|