12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Linq.Expressions;
- using EMIS.ViewModel;
- using EMIS.DataLogic.Repositories;
- using EMIS.Entities;
- using EMIS.ViewModel.EvaluationManage;
- namespace EMIS.DataLogic.Common.EvaluationManage
- {
- public class EvaluationControlDAL
- {
- public EvaluationControlRepository evaluationControlRepository { get; set; }
- public EvaluationSettingRepository EvaluationSettingRepository { get; set; }
- public EvaluationEnterRepository EvaluationEnterRepository { get; set; }
- public StudentRepository StudentRepository { get; set; }
- public SchoolyearRepository schoolyearRepository { get; set; }
- /// <summary>
- /// 读取评价控制信息
- /// </summary>
- /// <param name="exp"></param>
- /// <returns></returns>
- public IQueryable<EvaluationControlView> GetEvaluationControlQueryable(Expression<Func<EM_EvaluationControl, bool>> exp)
- {
- var query = from a in evaluationControlRepository.GetList(exp)
- join b in schoolyearRepository.Entities on a.SchoolyearID equals b.SchoolyearID
- select new EvaluationControlView
- {
- ControlID = a.EvaluationControlID,
- SchoolyearID = a.SchoolyearID,
- SchoolyearCode = b.Code,
- IsResult = a.IsCourseScoreLock.Value,
- Result = (a.IsCourseScoreLock.HasValue && a.IsCourseScoreLock == true) ? "是" : "否",
- IsCourse = a.IsSelectCourseLock.Value,
- Course = (a.IsSelectCourseLock.HasValue && a.IsSelectCourseLock == true) ? "是" : "否",
- AllowNotEvaluationCount = a.NoNumber == null ? 0 : a.NoNumber,
- CreateUserID = a.CreateUserID,
- CreateTime = a.CreateTime
- };
- return query;
- }
- ///获取学生没评的课程教师信息
- public IQueryable<EM_EvaluationSetting> GetStudentNotEvaluationList(Expression<Func<CF_Student, bool>> studentExp, Expression<Func<EM_EvaluationSetting, bool>> evaluationSettingExp)
- {
- var query = (from es in EvaluationSettingRepository.GetList(evaluationSettingExp)
- from ess in es.CF_Student
- join s in StudentRepository.GetList(studentExp) on ess.UserID equals s.UserID
- join ee in EvaluationEnterRepository.Entities
- on new { es.EducationMissionClassID, StudentUserID = (Guid?)ess.UserID }
- equals new { ee.EducationMissionClassID, ee.StudentUserID }
- into dee
- from eee in dee.DefaultIfEmpty()
- where eee.EducationMissionClassID == null && es.OpenStatus == (int)CF_YesOrNoStatus.Yes
- select es
- );
- return query;
- }
- }
- }
|