1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using EMIS.ViewModel.MinorGraduation.MinorGraduationSetting;
- using System.Linq.Expressions;
- using EMIS.Entities;
- using EMIS.DataLogic.Repositories;
- using EMIS.ViewModel.ScoreManage;
- using EMIS.ViewModel;
- namespace EMIS.DataLogic.MinorGraduation.MinorGraduationSetting
- {
- public class MinorGraduationConditionDAL
- {
- public MinorGraduationConditionRepository minorGraduationConditionRepository { get; set; }
- public FinallyScoreRepository finallyScoreRepository { get; set; }
- public StudentRepository studentRepository { get; set; }
- public SchoolyearRepository schoolyearRepository { get; set; }
- public CoursematerialRepository coursematerialRepository { get; set; }
- public MinorGraduationConditionPackageRepository minorGraduationConditionPackageRepository { get; set; }
- public IQueryable<MinorGraduationConditionView> GetMinorGraduationConditionQueryable(Expression<Func<ER_MinorGraduationCondition, bool>> exp)
- {
- var query = from gc in minorGraduationConditionRepository.GetList(exp)
- select new MinorGraduationConditionView
- {
- MinorGraduationConditionID = gc.MinorGraduationConditionID,
- Title = gc.Title,
- MethodFullName = gc.MethodFullName,
- IsEnable = gc.RecordStatus.Value > 0 ? true : false,
- RecordStatus = gc.RecordStatus,
- CreateUserID = gc.CreateUserID,
- CreateTime = gc.CreateTime,
- ModifyUserID = gc.ModifyUserID,
- ModifyTime = gc.ModifyTime
- };
- return query;
- }
- public IQueryable<StudentScoreView> GetFinallyScoreViewQueryableByUserID(Guid? userID)
- {
- //处理方式为辅修课的成绩
- var query = from finsco in finallyScoreRepository.GetList(x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE && x.UserID == userID && x.HandleModeID == (int)CF_HandleMode.MinorCourse)
- //join stu in studentRepository.GetList(expStudent)
- //on finsco.UserID equals stu.UserID
- //join sy in schoolyearRepository.Entities
- //on finsco.SchoolyearID equals sy.SchoolyearID
- //join cou in coursematerialRepository.Entities
- //on finsco.CoursematerialID equals cou.CoursematerialID
- select new StudentScoreView
- {
- FinallyScoreID = finsco.FinallyScoreID,
- SchoolyearID = finsco.SchoolyearID,
- UserID = finsco.UserID,
- CourseTypeID = finsco.CourseTypeID,
- Credit = finsco.Credit,
- TotalHours = finsco.TotalHours,
- ExamsCategoryID = finsco.ExamsCategoryID,
- ExamsStateID = finsco.ExamsStateID,
- TotalScore = finsco.TotalScore,
- ScoreCredit = finsco.ScoreCredit,
- SchoolyearNumID = finsco.SchoolyearNumID,
- StarttermID = finsco.StarttermID,
- ResultTypeID = finsco.ResultTypeID,
- CreateUserID = finsco.CreateUserID,
- CreateTime = finsco.CreateTime
- };
- return query;
- }
- public IQueryable<MinorGraduationConditionView> GetMinorGraduationConditionByPackageID(Expression<Func<ER_MinorGraduationConditionPackage, bool>> exp)
- {
- var query = from mgcpr in minorGraduationConditionPackageRepository.GetList(exp)
- from gc in mgcpr.ER_MinorGraduationCondition
- select new MinorGraduationConditionView
- {
- MinorGraduationConditionID = gc.MinorGraduationConditionID,
- Title = gc.Title,
- MethodFullName = gc.MethodFullName,
- IsEnable = gc.RecordStatus.Value > 0 ? true : false,
- RecordStatus = gc.RecordStatus,
- CreateUserID = gc.CreateUserID,
- CreateTime = gc.CreateTime,
- ModifyUserID = gc.ModifyUserID,
- ModifyTime = gc.ModifyTime
- };
- return query;
- }
- }
- }
|