123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using EMIS.DataLogic.Common.EvaluationManage;
- using Bowin.Common.Linq;
- using Bowin.Common.Linq.Entity;
- using EMIS.Entities;
- using EMIS.ViewModel;
- using System.Linq.Expressions;
- using EMIS.ViewModel.EvaluationManage;
- namespace EMIS.CommonLogic.EvaluationManage
- {
- public class EvaluationTeacherScoreServices: BaseServices, IEvaluationTeacherScoreServices
- {
- public EvaluationTeacherScoreDAL EvaluationTeacherScoreDAL { get; set; }
- public EvaluationTypeDAL EvaluationTypeDAL { get; set; }
- public IGridResultSet<EvaluationTeacherScoreView> GetEvaluationTeacherScoreViewGrid(ConfiguretView configuretView, Guid? schoolYearID, Guid? evaluationIntTypeID, Guid? evaluationTableTypeID, Guid? collegeID, Guid? DepartmentID, int pageIndex, int pageSize)
- {
- var curUser = EMIS.Utility.FormValidate.CustomPrincipal.Current;
- Expression<Func<EM_MissionClassTeacher, bool>> expmct = x => true;
- Expression<Func<EM_EvaluationTable, bool>> expTable = x => true;
- if (evaluationIntTypeID.HasValue && evaluationIntTypeID != Guid.Empty)
- {
- expTable = expTable.And(x => x.EvaluationIntTypeID == evaluationIntTypeID);
-
- }
- if (evaluationTableTypeID.HasValue && evaluationTableTypeID != Guid.Empty)
- {
- expTable = expTable.And(x => x.EvaluationTypeID == evaluationTableTypeID);
- //expTable = expTable.And(x => x.TypeID == evaluationTableTypeID);
- }
- if (schoolYearID.HasValue && schoolYearID != Guid.Empty)
- {
- expmct = expmct.And(x => x.EM_EducationMissionClass.EM_EducationMission.CF_Schoolyear.SchoolyearID == schoolYearID);
- }
- var query = EvaluationTeacherScoreDAL.GetEvaluationTeacherScoreQuery(expmct, expTable, schoolYearID);
- if (collegeID.HasValue)
- {
- query = query.Where(x => x.CollegeID == collegeID);
- }
- if (DepartmentID.HasValue)
- {
- query = query.Where(x => x.DepartmentID == DepartmentID);
- }
- if (!string.IsNullOrEmpty(configuretView.ConditionValue))
- query = query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue);
- query = this.GetQueryByDataRange(query, (x => x.UserID));
- //query2 = query2.OrderByDescending(x => x.TeacherNo);
- return query.OrderBy(x => x.CollegeRanking).ThenBy(x => x.DepartmentRanking).ToGridResultSet<EvaluationTeacherScoreView>(pageIndex, pageSize);
- }
- public IList<EvaluationTeacherScoreView> GetEvaluationTeacherScoreViewList(ConfiguretView configuretView, Guid? schoolYearID, Guid? evaluationIntTypeID, Guid? evaluationTableTypeID, Guid? collegeID, Guid? DepartmentID)
- {
- var curUser = EMIS.Utility.FormValidate.CustomPrincipal.Current;
- Expression<Func<EM_MissionClassTeacher, bool>> expmct = x => true;
- Expression<Func<EM_EvaluationTable, bool>> expTable = x => true;
- if (evaluationIntTypeID.HasValue && evaluationIntTypeID != Guid.Empty)
- {
- expTable = expTable.And(x => x.EvaluationIntTypeID == evaluationIntTypeID);
- }
- if (evaluationTableTypeID.HasValue && evaluationTableTypeID != Guid.Empty)
- {
- expTable = expTable.And(x => x.EvaluationTypeID == evaluationTableTypeID);
- }
- if (schoolYearID.HasValue && schoolYearID != Guid.Empty)
- {
- expmct = expmct.And(x => x.EM_EducationMissionClass.EM_EducationMission.CF_Schoolyear.SchoolyearID == schoolYearID);
- }
- var query = EvaluationTeacherScoreDAL.GetEvaluationTeacherScoreQuery(expmct, expTable, schoolYearID);
- if (collegeID.HasValue)
- {
- query = query.Where(x => x.CollegeID == collegeID);
- }
- if (DepartmentID.HasValue)
- {
- query = query.Where(x => x.DepartmentID == DepartmentID);
- }
- if (!string.IsNullOrEmpty(configuretView.ConditionValue))
- query = query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue);
- //query2 = query2.OrderByDescending(x => x.TeacherNo);
- return query.OrderBy(x => x.CollegeRanking).ThenBy(x => x.DepartmentRanking).ToList();
- }
- public Guid? GetEvaluaitonTableTypeID()
- {
- Expression<Func<EM_EvaluationType, bool>> expTable = x => true;
- expTable = expTable.And(x => x.Name.Equals("学生评"));
- var query = EvaluationTypeDAL.GetEvaluationTypeQueryable(expTable);
- return query.First().TypeID;
- }
- }
- }
|