123456789101112131415161718192021222324252627282930313233343536373839 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using EMISOnline.Entities;
- using Bowin.Common.Linq.Entity;
- using System.Linq.Expressions;
- using EMISOnline.ViewModel.Educational;
- using Bowin.Common.Linq;
- using EMISOnline.DataLogic.Educational;
- namespace EMISOnline.CommonLogic.EducationalServices
- {
- public class TeachingPlanServices : BaseServices, ITeachingPlanServices
- {
- public TeachingPlanDAL TeachingPlanDAL { get; set; }
- public IGridResultSet<TeachingPlanView> GetTeachingPlanList(int pageIndex, int pageSize, string grademajorName, string facultymajorName, string courseName)
- {
- Expression<Func<TeachingPlanView, bool>> exp = (e => true);
- if (!string.IsNullOrEmpty(grademajorName))
- {
- exp = exp.And(e => e.GrademajorName.Contains(grademajorName.Trim()));
- }
- if (!string.IsNullOrEmpty(facultymajorName))
- {
- exp = exp.And(e => e.StandardName.Contains(facultymajorName.Trim()));
- }
- if (!string.IsNullOrEmpty(courseName))
- {
- exp = exp.And(e => e.CourseName.Contains(courseName.Trim()));
- }
- var list = TeachingPlanDAL.GetTeachingPlanList().Where(exp).OrderByDescending(r => r.SchoolyearValue).ThenBy(x => x.CourseName).ToGridResultSet(pageIndex, pageSize);
- return list;
- }
- }
- }
|