12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Linq.Expressions;
- using EMIS.ViewModel.DQPSystem;
- using EMIS.ViewModel;
- using EMIS.DataLogic.DQPSystem;
- using EMIS.Entities;
- using Bowin.Common.Linq.Entity;
- namespace EMIS.CommonLogic.DQPSystem
- {
- public class CommunicateServices : BaseServices, ICommunicateServices
- {
- public CommunicateDAL CommunicateDAL { get; set; }
- public IGridResultSet<TeacherCommunicateView> GetTeacherCommunicateViewList(ConfiguretView conditionView, Guid schoolyearID, Guid coursematerialID, Guid userID, int? pageIndex, int? pageSize)
- {
- Expression<Func<CF_Staff, bool>> staffExp = (x => x.UserID == userID);
- Expression<Func<DQP_SOC, bool>> socExp = (x => x.SchoolyearID == schoolyearID && x.CoursematerialID == coursematerialID);
- var query = this.CommunicateDAL.GetTeacherCommunicateViewQueryable(staffExp, socExp);
- if (!string.IsNullOrEmpty(conditionView.ConditionValue) && !string.IsNullOrEmpty(conditionView.Attribute))
- query = query.DynamicWhere(conditionView.Attribute, conditionView.Condition, conditionView.ConditionValue);
- query = query.OrderBy(x => x.ClassmajorNo)
- .ThenBy(x => x.LoginID);
- return query.ToGridResultSet(pageIndex, pageSize);
- }
- public IGridResultSet<StudentCommunicateView> GetStudentCommunicateViewList(ConfiguretView conditionView, Guid schoolyearID, Guid coursematerialID, Guid userID, int? pageIndex, int? pageSize)
- {
- Expression<Func<CF_Student, bool>> studentExp = (x => x.UserID == userID);
- Expression<Func<DQP_SOC, bool>> socExp = (x => x.SchoolyearID == schoolyearID && x.CoursematerialID == coursematerialID);
- var query = this.CommunicateDAL.GetStudentCommunicateViewQueryable(studentExp, socExp);
- if (!string.IsNullOrEmpty(conditionView.ConditionValue) && !string.IsNullOrEmpty(conditionView.Attribute))
- query = query.DynamicWhere(conditionView.Attribute, conditionView.Condition, conditionView.ConditionValue);
- query = query.OrderBy(x => x.RoleOrder)
- .ThenBy(x => x.ClassmajorNo)
- .ThenBy(x => x.LoginID);
- return query.ToGridResultSet(pageIndex, pageSize);
- }
- }
- }
|