using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Bowin.Common.Linq;
using EMISOnline.Entities;
using EMISOnline.DataLogic.Repositories;
using EMISOnline.ViewModel.SystemView;
using System.Linq.Expressions;
using EMISOnline.ViewModel.Student;
namespace EMISOnline.DataLogic.Student
{
public class CourseEaxmDAL
{
public onlinetestRepository onlinetestRepository { get; set; }
///
/// 获取学生计划表
///
///
///
public IQueryable getStudentEaxmListbySchoolyear(Guid UserID, Guid SchoolcodeID)
{
var sql = from semc in onlinetestRepository.UnitOfWork.V_StudentEducationMissionClass.Where(w => w.UserID == UserID && w.SchoolyearID == SchoolcodeID)
join t in onlinetestRepository.Entities on semc.EducationMissionClassID equals t.EducationMissionClassID
join e in onlinetestRepository.UnitOfWork.ExamResult on t.onlinetest_id equals e.onlinetest_id into me
from ee in me.DefaultIfEmpty()
select new CourseExamView
{
CoursematerialID = semc.CoursematerialID,
CourseName = semc.CourseName,
test_name = t.test_name,
ExamStatus = ee==null?2:ee.state,
ExamScore = ee==null?0:ee.score,
ExamStatusName = "",
PassRate = t.PassRate,
limited_minutes = t.limited_minutes,
test_begin_date=t.test_begin_date, test_end_date=t.test_end_date};
return sql;
}
}
}