using System; using System.Collections.Generic; using System.Linq; using System.Text; using EMISOnline.Entities; using EMISOnline.DataLogic.Educational; using EMISOnline.ViewModel.Educational; using Bowin.Common.Linq.Entity; using Bowin.Common.Linq; using System.Linq.Expressions; namespace EMISOnline.CommonLogic.EducationalServices { public class CourseServices : BaseServices, ICourseServices { public CourseDAL CourseDAL { get; set; } public IGridResultSet GetCoursematerList(int pageIndex, int pageSize, string courseName) { Expression> exp = (e => true); if (!string.IsNullOrEmpty(courseName)) { exp = exp.And(e => e.CourseName.Contains(courseName.Trim())); } var list = CourseDAL.GetCoursematerialViewQueryable().Where(exp).OrderByDescending(r => r.CreateTime).ToGridResultSet(pageIndex, pageSize); return list; } } }