12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using Bowin.Common.Linq;
- using Bowin.Common.Linq.Entity;
- using EMIS.ViewModel.EvaluationManage;
- using EMIS.ViewModel;
- using EMIS.DataLogic.Common.EvaluationManage;
- using System.Linq.Expressions;
- using EMIS.Entities;
- namespace EMIS.CommonLogic.EvaluationManage
- {
- public class TeacherEvaluationCountServices:BaseServices, ITeacherEvaluationCountServices
- {
- public TeacherEvaluationCountDAL TeacherEavluationCountDAL { get; set; }
- public IGridResultSet<TeacherEvaluationCountView> GetTeacherView(ViewModel.ConfiguretView configuretView, Guid? collegeID, Guid? schoolyearID, Guid? typeID, Guid? departmentID, int pageIndex, int pageSize)
- {
- Expression<Func<EMIS.Entities.CF_Schoolyear, bool>> filter = x => true;
- Expression<Func<EM_EvaluationSetting, bool>> espset = x => true;
- if (schoolyearID.HasValue && schoolyearID != Guid.Empty)
- {
- filter = filter.And(x => x.SchoolyearID == schoolyearID);
- }
- if (typeID.HasValue && typeID != Guid.Empty)
- {
- espset = espset.And(x => x.EvaluationTypeID == typeID);
- }
- var curUser = EMIS.Utility.FormValidate.CustomPrincipal.Current;
- var query = TeacherEavluationCountDAL.GetTeacherView(filter, espset);
- query = query.OrderBy(x => x.TeacherNo);
- if (!string.IsNullOrEmpty(configuretView.ConditionValue))
- query = query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue);
- if (collegeID.HasValue)
- {
- query = query.Where(x => x.CollegeID == collegeID);
- }
- //if (typeID.HasValue)
- //{
- // query = query.Where(x => x.EvaluationTypeID == typeID);
- //}
- if (departmentID.HasValue)
- {
- query = query.Where(x => x.DepartmentID == departmentID);
- }
- return query.ToGridResultSet(pageIndex, pageSize);
- }
- public IList<TeacherEvaluationCountView> GetTeacherView(ViewModel.ConfiguretView configuretView, Guid? collegeID, Guid? schoolyearID, Guid? typeID, Guid? departmentID)
- {
- Expression<Func<EMIS.Entities.CF_Schoolyear, bool>> filter = x => true;
- Expression<Func<EM_EvaluationSetting, bool>> espset = x => true;
- if (schoolyearID.HasValue && schoolyearID != Guid.Empty)
- {
- filter = filter.And(x => x.SchoolyearID == schoolyearID);
- }
- if (typeID.HasValue && typeID != Guid.Empty)
- {
- espset = espset.And(x => x.EvaluationTypeID == typeID);
- }
- var curUser = EMIS.Utility.FormValidate.CustomPrincipal.Current;
- var query = TeacherEavluationCountDAL.GetTeacherView(filter, espset);
- //query = query.OrderBy(x => x.ClassmajorID).ThenBy(x => x.StudentNo);
- if (!string.IsNullOrEmpty(configuretView.ConditionValue))
- query = query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue);
- if (collegeID.HasValue)
- {
- query = query.Where(x => x.CollegeID == collegeID);
- }
- //if (typeID.HasValue)
- //{
- // query = query.Where(x => x.EvaluationTypeID == typeID);
- //}
- if (departmentID.HasValue)
- {
- query = query.Where(x => x.DepartmentID == departmentID);
- }
- return query.ToList();
- }
- }
- }
|