1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- using System;
- using System.Collections.Generic;
- using System.Data.Entity;
- using System.Linq;
- using System.Linq.Expressions;
- 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 EMIS.Entities;
- namespace EMIS.CommonLogic.EvaluationManage
- {
- public class SatisfyRateServices : BaseServices, ISatisfyRateServices
- {
- public SatisfyRateDAL SatisfyRateDAL { get; set; }
- public IGridResultSet<SatisfyRateView> GetSatisfyRateViewList(ConfiguretView configuretView, Guid? evaluationTypeID, Guid? collegeID, int? teacherTypeID, int pageIndex, int pageSize)
- {
- Expression<Func<CF_Staff, bool>> filter = x => true;
- Expression<Func<EM_EvaluationType, bool>> typeFilter = x => true;
- if (collegeID.HasValue)
- {
- filter = filter.And(x => x.CollegeID == collegeID);
- }
- if (evaluationTypeID.HasValue)
- {
- typeFilter = typeFilter.And(x => x.EvaluationTypeID == evaluationTypeID);
- }
- if (teacherTypeID.HasValue)
- {
- filter = filter.And(x => x.TeacherTypeID == teacherTypeID);
- }
- var query = SatisfyRateDAL.GetUserSatisfyRateView(filter, typeFilter);
- if (!string.IsNullOrEmpty(configuretView.ConditionValue))
- query = query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue);
- return this.GetQueryByDataRangeByCollege(query).OrderByDescending(x => x.SatisfyRate).ThenBy(x => x.LoginID)
- .ToGridResultSet(pageIndex, pageSize);
- }
- public List<SatisfyRateView> GetSatisfyRateViewList(ConfiguretView configuretView, Guid? evaluationTypeID, Guid? collegeID, int? teacherTypeID)
- {
- Expression<Func<CF_Staff, bool>> filter = x => true;
- Expression<Func<EM_EvaluationType, bool>> typeFilter = x => true;
- if (collegeID.HasValue)
- {
- filter = filter.And(x => x.CollegeID == collegeID);
- }
- if (evaluationTypeID.HasValue)
- {
- typeFilter = typeFilter.And(x => x.EvaluationTypeID == evaluationTypeID);
- }
- if (teacherTypeID.HasValue)
- {
- filter = filter.And(x => x.TeacherTypeID == teacherTypeID);
- }
- var query = SatisfyRateDAL.GetUserSatisfyRateView(filter, typeFilter);
- if (!string.IsNullOrEmpty(configuretView.ConditionValue))
- query = query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue);
- return this.GetQueryByDataRangeByCollege(query).OrderByDescending(x => x.SatisfyRate).ThenBy(x => x.LoginID).ToList();
- }
- }
- }
|