1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using Bowin.Common.Linq.Entity;
- using EMIS.ViewModel.ScoreManage;
- using System.Linq.Expressions;
- using EMIS.Entities;
- using Bowin.Common.Linq;
- using EMIS.DataLogic.ScoreManage;
- using EMIS.ViewModel;
- namespace EMIS.CommonLogic.ScoreManage
- {
- public class NotPassStudentServices: BaseServices, INotPassStudentServices
- {
- public NotPassStudentDAL notPassStudentDAL { get; set; }
- /// <summary>
- /// 获取不及格学生名单
- /// </summary>
- /// <param name="configuretView"></param>
- /// <param name="campusID"></param>
- /// <param name="years"></param>
- /// <param name="standardID"></param>
- /// <param name="classMajorID"></param>
- /// <param name="count"></param>
- /// <param name="pageIndex"></param>
- /// <param name="pageSize"></param>
- /// <returns></returns>
- public IGridResultSet<NotPassStudentView> GetNotPassStudentGrid(ConfiguretView configuretView, Guid? campusID, int? years, int? standardID, Guid? classMajorID, int pageIndex, int pageSize)
- {
- Expression<Func<Sys_User, bool>> exp = x => true;
- if (campusID.HasValue)
- {
- exp = exp.And(x => x.CF_Student.CF_Classmajor.CF_Grademajor.CF_Facultymajor.CF_College.CF_Campus.CampusID == campusID);
- }
- if (standardID.HasValue)
- {
- exp = exp.And(x => x.CF_Student.CF_Classmajor.CF_Grademajor.CF_Facultymajor.StandardID == standardID);
- }
- if (years.HasValue)
- {
- exp = exp.And(x => x.CF_Student.CF_Classmajor.CF_Grademajor.CF_Schoolyear.Years == years);
- }
- if (classMajorID.HasValue)
- {
- exp = exp.And(x => x.CF_Student.CF_Classmajor.ClassmajorID == classMajorID);
- }
- var query = notPassStudentDAL.GetScoreViewQueryable(exp).Where(x => x.NotPassCount > 0);
- //if (count.HasValue)
- //{
- // query = query.Where(x => x.NotPassCount == count);
- //}
- if (!string.IsNullOrEmpty(configuretView.ConditionValue))
- query = query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue.Trim());
- var result = query.OrderBy(x => x.CampusID).ThenBy(x => x.Years).ThenBy(x => x.StandardID).ThenBy(x => x.ClassMajorID).ToGridResultSet<NotPassStudentView>(pageIndex, pageSize);
- return result;
- }
- }
- }
|