using System; using System.Collections.Generic; using System.Linq; using System.Text; using Bowin.Common.Linq; using EMIS.CommonLogic.SystemServices; using EMIS.Entities; using Bowin.Common.Linq.Entity; using EMIS.ViewModel.DifferentDynamic; using EMIS.ViewModel; using EMIS.DataLogic.Common.Students; using System.Linq.Expressions; namespace EMIS.CommonLogic.Students { public class ReentryServices : BaseWorkflowServices, IReentryServices { public DifferentDynamicDAL DifferentDynamicDAL { get; set; } public IGridResultSet GetStudentReentryViewGrid(ConfiguretView configuretView, Guid? returnSchoolyearID, Guid? campusID, Guid? collegeID, int? education, int? year, int? standard, int? learningform, int pageIndex, int pageSize) { var endStatusID = this.GetCorrectEndStatus(); Expression> filter = (x => true); Expression> collegeFilter = (x => true); Expression> facultyFilter = (x => true); Expression> gradeFilter = (x => true); if (returnSchoolyearID.HasValue) { filter = filter.And(x => x.ReturnSchoolyearID == returnSchoolyearID); } if (campusID.HasValue) { collegeFilter = collegeFilter.And(x => x.CampusID == campusID); } if (collegeID.HasValue) { collegeFilter = collegeFilter.And(x => x.CollegeID == collegeID); } if (education.HasValue) { facultyFilter = facultyFilter.And(x => x.EducationID == education); } if (year.HasValue) { gradeFilter = gradeFilter.And(x => x.GradeID == year); } if (standard.HasValue) { facultyFilter = facultyFilter.And(x => x.StandardID == standard); } if (learningform.HasValue) { facultyFilter = facultyFilter.And(x => x.LearningformID == learningform); } var query = DifferentDynamicDAL.GetNeedReturnList(filter, endStatusID.Value, gradeFilter, facultyFilter, collegeFilter); query = GetQueryByDataRangeByCollege(query); if (!string.IsNullOrEmpty(configuretView.ConditionValue)) query = query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue); query = query.OrderByDescending(w => w.CreateTime); var result = query.ToGridResultSet(pageIndex, pageSize); return result; } public List GetStudentReentryViewList(ConfiguretView configuretView, Guid? returnSchoolyearID, Guid? campusID, Guid? collegeID, int? education, int? year, int? standard, int? learningform) { var endStatusID = this.GetCorrectEndStatus(); Expression> filter = (x => true); Expression> collegeFilter = (x => true); Expression> facultyFilter = (x => true); Expression> gradeFilter = (x => true); if (returnSchoolyearID.HasValue) { filter = filter.And(x => x.ReturnSchoolyearID == returnSchoolyearID); } if (campusID.HasValue) { collegeFilter = collegeFilter.And(x => x.CampusID == campusID); } if (collegeID.HasValue) { collegeFilter = collegeFilter.And(x => x.CollegeID == collegeID); } if (education.HasValue) { facultyFilter = facultyFilter.And(x => x.EducationID == education); } if (year.HasValue) { gradeFilter = gradeFilter.And(x => x.GradeID == year); } if (standard.HasValue) { facultyFilter = facultyFilter.And(x => x.StandardID == standard); } if (learningform.HasValue) { facultyFilter = facultyFilter.And(x => x.LearningformID == learningform); } var query = DifferentDynamicDAL.GetNeedReturnList(filter, endStatusID.Value, gradeFilter, facultyFilter, collegeFilter); query = GetQueryByDataRangeByCollege(query); if (!string.IsNullOrEmpty(configuretView.ConditionValue)) query = query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue); query = query.OrderByDescending(w => w.CreateTime); var result = query.ToList(); return result; } } }