110,567
社区成员
发帖
与我相关
我的任务
分享
TeachEasEntities db = new TeachEasEntities(Public.Dbase.DataBaseEFConn);
private IEnumerable<exam_Batch> ExamBatch_GetList(string yearTermID, string examWeek, string weekSection)
{
string weekSection2 = weekSection;
if (weekSection.Substring(1) == "1" || weekSection.Substring(1) == "3")
weekSection2 = (int.Parse(weekSection) + 1).ToString();
var query = from r in db.exam_Batch
where r.YearTermID == yearTermID && r.ExamWeek == examWeek && ((r.WeekSection == weekSection && r.WeekTime == 2) || ((r.WeekSection == weekSection2 || r.WeekSection == weekSection) && r.WeekTime == 3))
select r;
return query;
}
public override IEnumerable<View_All> ExamRoomStudent_GetRoomList(string yearTermID, string examWeek, string weekSection, string roomID)
{
var queryBatch = ExamBatch_GetList(yearTermID, examWeek, weekSection);
//获得学生列表
var queryStud = from r in queryBatch
from y in db.exam_Room
from s in db.exam_RoomStudent
from t in db.e_Student
from q in db.t_TeachTask
where r.YearTermID == y.YearTermID && r.BatchOrder == y.BatchOrder && r.BatchFlag == (byte)ExamBatchInfo.Enum_BatchFlag.Released
&& y.ExamRoomID == s.ExamRoomID
&& y.YearTermID == q.YearTermID && y.CourID == q.CourID && y.CourOrder == q.CourOrder
&& s.StudID == t.StudID
&& y.RoomID == roomID
select new {
YearTermID = y.YearTermID,
CourID = y.CourID,
CourOrder = y.CourOrder,
CourName = q.CourName,
StudName = t.StudName,
ClassName = t.ClassName,
StudID = t.StudID,
};
return query;
}
TeachEasEntities db = new TeachEasEntities(Public.Dbase.DataBaseEFConn);
public override IEnumerable<View_All> ExamRoomStudent_GetRoomList(string yearTermID, string examWeek, string weekSection, string roomID)
{
string weekSection2 = weekSection;
if (weekSection.Substring(1) == "1" || weekSection.Substring(1) == "3")
weekSection2 = (int.Parse(weekSection) + 1).ToString();
var queryBatch = from r in db.exam_Batch
where r.YearTermID == yearTermID && r.ExamWeek == examWeek && ((r.WeekSection == weekSection && r.WeekTime == 2) || ((r.WeekSection == weekSection2 || r.WeekSection == weekSection) && r.WeekTime == 3))
select r;
//获得学生列表
var queryStud = from r in queryBatch
from y in db.exam_Room
from s in db.exam_RoomStudent
from t in db.e_Student
from q in db.t_TeachTask
where r.YearTermID == y.YearTermID && r.BatchOrder == y.BatchOrder && r.BatchFlag == (byte)ExamBatchInfo.Enum_BatchFlag.Released
&& y.ExamRoomID == s.ExamRoomID
&& y.YearTermID == q.YearTermID && y.CourID == q.CourID && y.CourOrder == q.CourOrder
&& s.StudID == t.StudID
&& y.RoomID == roomID
select new {
YearTermID = y.YearTermID,
CourID = y.CourID,
CourOrder = y.CourOrder,
CourName = q.CourName,
StudName = t.StudName,
ClassName = t.ClassName,
StudID = t.StudID,
};
return query;
}
string weekSection2 = weekSection;
if (weekSection.Substring(1) == "1" || weekSection.Substring(1) == "3")
weekSection2 = (int.Parse(weekSection) + 1).ToString();
var queryBatch = from r in db.exam_Batch
where r.YearTermID == yearTermID && r.ExamWeek == examWeek && ((r.WeekSection == weekSection && r.WeekTime == 2) || ((r.WeekSection == weekSection2 || r.WeekSection == weekSection) && r.WeekTime == 3))
select r;