123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- 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 System.Linq.Expressions;
- using EMIS.Entities;
- namespace EMIS.CommonLogic.EvaluationManage
- {
- public class StudentEvaluationCountServices : BaseServices, IStudentEvaluationCountServices
- {
- public StudentEvaluationCountDAL StudentEvaluationCountDAL { get; set; }
- public IGridResultSet<StudentEvaluationCountView> GetStudentView(ConfiguretView configuretView, int? schoolyearNumID,
- Guid? collegeID, Guid? schoolyearID, int? standardID, Guid? classID, int pageIndex, int pageSize)
- {
- Expression<Func<EMIS.Entities.CF_Schoolyear, bool>> filter = x => true;
- if (schoolyearID.HasValue && schoolyearID != Guid.Empty)
- {
- filter = filter.And(x => x.SchoolyearID == schoolyearID);
- }
-
- var curUser = EMIS.Utility.FormValidate.CustomPrincipal.Current;
- var query = StudentEvaluationCountDAL.GetStudentView(filter);
- query = query.OrderBy(x => x.ClassmajorID).ThenBy(x => x.StudentNo);
- if (!string.IsNullOrEmpty(configuretView.ConditionValue))
- query = query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue);
- if (schoolyearNumID.HasValue)
- {
- query = query.Where(x => x.SchoolyearNumID == schoolyearNumID);
- }
- if (collegeID.HasValue)
- {
- query = query.Where(x => x.CollegeID == collegeID);
- }
-
- if (standardID.HasValue&&standardID>0)
- {
- query = query.Where(x => x.StandardID == standardID);
- }
- if (classID.HasValue)
- {
- query = query.Where(x => x.ClassmajorID == classID);
- }
-
- return query.ToGridResultSet(pageIndex, pageSize);
- }
- public IList<StudentEvaluationCountView> GetStudentView(ConfiguretView configuretView, int? schoolyearNumID,
- Guid? collegeID, Guid? schoolyearID, int? standardID, Guid? classID)
- {
- Expression<Func<EMIS.Entities.CF_Schoolyear, bool>> filter = x => true;
- if (schoolyearID.HasValue && schoolyearID != Guid.Empty)
- {
- filter = filter.And(x => x.SchoolyearID == schoolyearID);
- }
- var curUser = EMIS.Utility.FormValidate.CustomPrincipal.Current;
- var query = StudentEvaluationCountDAL.GetStudentView(filter);
- if (!string.IsNullOrEmpty(configuretView.ConditionValue))
- query = query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue);
- if (schoolyearNumID.HasValue)
- {
- query = query.Where(x => x.SchoolyearNumID == schoolyearNumID);
- }
- if (collegeID.HasValue)
- {
- query = query.Where(x => x.CollegeID == collegeID);
- }
- //if (schoolyearID.HasValue)
- //{
- // query = query.Where(x => x.SchoolyearID == schoolyearID);
- //}
- if (standardID.HasValue)
- {
- query = query.Where(x => x.StandardID == standardID);
- }
- if (classID.HasValue)
- {
- query = query.Where(x => x.ClassmajorID == classID);
- }
- query = query.OrderByDescending(o => o.SchoolyearID);
- return query.ToList();
- }
- }
- }
|