123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using EMIS.DataLogic.Repositories;
- using System.Linq.Expressions;
- using EMIS.Entities;
- using EMIS.ViewModel.EvaluationManage;
- using EMIS.DataLogic.SystemDAL;
- using EMIS.ViewModel;
- using Bowin.Common.Linq;
- using EMIS.Utility;
- using EMIS.DataLogic.Common.Students;
- namespace EMIS.DataLogic.Common.EvaluationManage
- {
- public class EvaluationAdviseDAL
- {
- public EducationMissionClassRepository EducationMissionClassRepository { get; set; }
- public ParameterRepository parameterRepository { get; set; }
- public MissionClassTeacherRepository missionClassTeacherRepository { get; set; }
- public CoursematerialRepository coursematerialRepository { get; set; }
- public EvaluationEnterRepository evaluationEnterRepository { get; set; }
- public EvaluationTypeRepository evaluationTypeRepository { get; set; }
- public EvaluationTableRepository evaluationTableRepository { get; set; }
- public EducationMissionRepository educationMissionRepository { get; set; }
- public SchoolyearRepository schoolyearRepository { get; set; }
- public IQueryable<EvaluationAdviseView> GetEvaluationAdviseQuery()
- {
- var query = from a in EducationMissionClassRepository.Entities
- from b in a.EM_EvaluationSetting
- from c in a.EM_EvaluationEnter
- select new EvaluationAdviseView
- {
- Sys_User = a.EM_MissionClassTeacher.Select(s => s.CF_Staff.Sys_User),
- CoursematerialID = a.EM_Coursematerial.CoursematerialID,
- CourseName = a.EM_Coursematerial.CourseName,
- CourseCode = a.EM_Coursematerial.CourseCode,
- EducationMissionClassName = a.Name,
- EvaluationTypeID = c.EM_EvaluationTable.EM_EvaluationType.EvaluationTypeID,
- EvaluationTypeName = c.EM_EvaluationTable.EM_EvaluationType.Name,
- SchoolyearCode = c.EM_EducationMissionClass.EM_EducationMission.CF_Schoolyear.Code,
- SchoolyearID = c.EM_EducationMissionClass.EM_EducationMission.CF_Schoolyear.SchoolyearID,
- EvaluationTableID = c.EvaluationTableID,
- EvaluationTableName = c.EM_EvaluationTable.Name,
- CollegeID = c.EM_EducationMissionClass.EM_EducationMission.CF_College.CollegeID,
- DepartmentID = c.EM_EducationMissionClass.EM_EducationMission.CF_Department.DepartmentID,
- Remark = c.Remark
- };
- return query;
- }
- public IQueryable<EvaluationAdviseView> GetMyEvaluationQuery(Expression<Func<EM_EducationMissionClass, bool>> emcexp, Expression<Func<EM_EducationMission, bool>> emexp,
- Expression<Func<EM_EvaluationEnter, bool>> eeexp, Expression<Func<EM_EvaluationTable, bool>> etexp)
- {
- //int paramterTypeID = (int)CF_ParameterType.SensitiveWords;
- //var paraquery = from a in parameterRepository.GetList(x => x.ParameterTypeID == paramterTypeID)
- // select new
- // {
- // Value = a.Value,
- // };
- ////List<String> valueList = new List<string>();
- //List<String> sArray = new List<string>();
- ////var values = paraquery.FirstOrDefault().Value;
- //if (paraquery != null)
- //{
- // var values = paraquery.FirstOrDefault().Value;
- // sArray = values.Split('|').ToList();
- //}
- //else
- //{
- // sArray = null;
- //}
- var query = from emcr in EducationMissionClassRepository.GetList(emcexp)
- join emr in educationMissionRepository.GetList(emexp)
- on emcr.EducationMissionID equals emr.EducationMissionID
- join sr in schoolyearRepository.Entities
- on emr.SchoolyearID equals sr.SchoolyearID
- join cmr in coursematerialRepository.Entities
- on emcr.CoursematerialID equals cmr.CoursematerialID
- join eer in evaluationEnterRepository.GetList(eeexp)
- on emcr.EducationMissionClassID equals eer.EducationMissionClassID
- join table in evaluationTableRepository.GetList(etexp)
- on eer.EvaluationTableID equals table.EvaluationTableID
- join etr in evaluationTypeRepository.Entities
- on table.EvaluationTypeID equals etr.EvaluationTypeID
- select new EvaluationAdviseView
- {
- Sys_User = emcr.EM_MissionClassTeacher.Select(x => x.CF_Staff.Sys_User),
- CoursematerialID = cmr.CoursematerialID,
- CourseName = cmr.CourseName,
- CourseCode = cmr.CourseCode,
- EducationMissionClassName = emcr.Name,
- EvaluationTypeID = etr.EvaluationTypeID,
- EvaluationTypeName = etr.Name,
- SchoolyearCode = sr.Code,
- SchoolyearID = sr.SchoolyearID,
- EvaluationTableID = table.EvaluationTableID,
- EvaluationTableName = table.Name,
- Remark = eer.Remark,
- };
- //var query = from a in EducationMissionClassRepository.Entities
- // from b in a.EM_EvaluationSetting
- // from c in a.EM_EvaluationEnter
- // select new EvaluationAdviseView
- // {
- // Sys_User = a.EM_MissionClassTeacher.Select(s => s.CF_Staff.Sys_User),
- // CoursematerialID = a.EM_Coursematerial.CoursematerialID,
- // CourseName = a.EM_Coursematerial.CourseName,
- // CourseCode = a.EM_Coursematerial.CourseCode,
- // EducationMissionClassName = a.Name,
- // EvaluationTypeID = c.EM_EvaluationTable.EM_EvaluationType.TypeID,
- // EvaluationTypeName = c.EM_EvaluationTable.EM_EvaluationType.Name,
- // SchoolyearCode = c.EM_EducationMissionClass.EM_EducationMission.CF_Schoolyear.Code,
- // SchoolyearID = c.EM_EducationMissionClass.EM_EducationMission.CF_Schoolyear.SchoolyearID,
- // EvaluationTableID = c.EvaluationTableID,
- // EvaluationTableName = c.EM_EvaluationTable.Name,
- // CollegeID = c.EM_EducationMissionClass.EM_EducationMission.CF_College.CollegeID,
- // DepartmentID = c.EM_EducationMissionClass.EM_EducationMission.CF_Department.DepartmentID,
- // Remark = valueList.Any(y => c.Remark.Contains(y.ToString())) ? "" : c.Remark,
- // };
- return query;
- }
- }
- }
|