1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- 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 CourseScoreDAL
- {
- public TeacherScoreRepository teacherScoreRepository { get; set; }
- public StudentEducationMissionClassRepository studentEducationMissionClassRepository { get; set; }
- public IQueryable<ER_TeacherScore> getTeacherScore(Expression<Func<ER_TeacherScore, bool>> tsExpression)
- {
- var sql = teacherScoreRepository.GetList(tsExpression);
- return sql;
- }
- public IQueryable<studentEducationMissionClassAddView> getStudentEducationAdd(Guid UserID,string CoursematerialName, string YearsCode)
- {
- var sql = from v in studentEducationMissionClassRepository.GetList(w => w.UserID == UserID)
- join sy in studentEducationMissionClassRepository.UnitOfWork.CF_Schoolyear on v.SchoolyearID equals sy.SchoolyearID
- join stu in studentEducationMissionClassRepository.UnitOfWork.CF_Student on v.UserID equals stu.UserID
- join u in studentEducationMissionClassRepository.UnitOfWork.Sys_User on v.UserID equals u.UserID
- select new studentEducationMissionClassAddView { CoursematerialID=v.CoursematerialID,
- CourseName=v.CourseName,
- CoverUrl=v.CoverUrl,
- EducationMissionClassID=v.EducationMissionClassID,
- EducationMissionClassName=v.EducationMissionClassName,
- UserID=v.UserID,
- SchoolyearID=v.SchoolyearID,
- yearCode=sy.Code,
- years=sy.Years,
- StudentCardNo=u.LoginID,
- StudentName=u.Name
- };
- if (!string.IsNullOrEmpty(CoursematerialName))
- {
- sql = sql.Where(w => w.CourseName.Contains(CoursematerialName));
- }
- if (!string.IsNullOrEmpty(YearsCode))
- {
- sql = sql.Where(w => w.yearCode.Contains(YearsCode));
- }
- return sql;
- }
- }
- }
|