12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using Bowin.Common.Linq.Entity;
- using EMIS.ViewModel.ExaminationManage;
- using EMIS.ViewModel;
- using System.Linq.Expressions;
- using EMIS.Entities;
- using Bowin.Common.Linq;
- using EMIS.DataLogic.ExaminationManage;
- namespace EMIS.CommonLogic.ExaminationManage
- {
- public class StudentExaminationCourseServices : BaseServices,IStudentExaminationCourseServices
- {
- public StudentExaminationCourseDAL studentExaminationCourseDAL { get; set; }
- public IGridResultSet<StudentExaminationCourseView> GetStudentExaminationCourseViewList(ConfiguretView configuretView,
- Guid? schoolyearID, int? examsCategoryID, int? examinationModeID, int? examinationStyleID, Guid userID, int pageIndex, int pageSize)
- {
- Expression<Func<EX_ExaminationPlan, bool>> exp = (x => x.RecordStatus == (int)EX_ExaminationPlanStatus.Submitted);
- if (schoolyearID.HasValue)
- {
- exp = exp.And(x => x.SchoolyearID == schoolyearID);
- }
- if (examsCategoryID.HasValue)
- {
- exp = exp.And(x => x.ExamsCategoryID == examsCategoryID);
- }
- if (examinationModeID.HasValue)
- {
- exp = exp.And(x => x.ExaminationModeID == examinationModeID);
- }
- if (examinationStyleID.HasValue)
- {
- exp = exp.And(x => x.ExaminationStyleID == examinationStyleID);
- }
-
- var query = studentExaminationCourseDAL.GetExaminationPlanView(exp, userID);
- if (!string.IsNullOrEmpty(configuretView.ConditionValue) && !string.IsNullOrEmpty(configuretView.Attribute))
- query = query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue);
- var result = query.OrderBy(x => x.SchoolyearCode).ThenBy(x => x.ExaminationDate).ThenBy(x => x.StartTime).ToGridResultSet<StudentExaminationCourseView>(pageIndex, pageSize);
- return result;
- }
- public List<StudentExaminationCourseView> GetStudentExaminationCourseViewList(ConfiguretView configuretView,
- Guid? schoolyearID, int? examsCategoryID, int? examinationModeID, int? examinationStyleID, Guid userID, List<Guid?> selectIDlist)
- {
- Expression<Func<EX_ExaminationPlan, bool>> exp = (x => x.RecordStatus == (int)EX_ExaminationPlanStatus.Submitted);
- if (schoolyearID.HasValue)
- {
- exp = exp.And(x => x.SchoolyearID == schoolyearID);
- }
- if (examsCategoryID.HasValue)
- {
- exp = exp.And(x => x.ExamsCategoryID == examsCategoryID);
- }
- if (examinationModeID.HasValue)
- {
- exp = exp.And(x => x.ExaminationModeID == examinationModeID);
- }
- if (examinationStyleID.HasValue)
- {
- exp = exp.And(x => x.ExaminationStyleID == examinationStyleID);
- }
- if (selectIDlist.Count > 0)
- {
- exp = exp.And(x => selectIDlist.Contains(x.ExaminationPlanID));
- }
- var query = studentExaminationCourseDAL.GetExaminationPlanView(exp, userID);
- if (!string.IsNullOrEmpty(configuretView.ConditionValue) && !string.IsNullOrEmpty(configuretView.Attribute))
- query = query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue);
- var result = query.OrderBy(x => x.SchoolyearCode).ThenBy(x => x.ExaminationDate).ThenBy(x => x.StartTime).ToList();
- return result;
- }
-
- }
- }
|