using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Linq.Expressions; using EMISOnline.Entities; using EMISOnline.DataLogic.Educational; using Bowin.Common.Linq.Entity; using EMISOnline.ViewModel.Educational; using Bowin.Common.Linq; namespace EMISOnline.CommonLogic.EducationalServices { public class CollegeServices : BaseServices, ICollegeServices { public CollegeDAL CollegeDAL { get; set; } public IGridResultSet GetCollegeList(int pageIndex, int pageSize, string collegeName, string collegeNo) { Expression> exp = (x => true); if (!string.IsNullOrEmpty(collegeName)) { exp = exp.And(e => e.Name.Contains(collegeName.Trim())); } if (!string.IsNullOrEmpty(collegeNo)) { exp = exp.And(e => e.No.Contains(collegeNo.Trim())); } var list = CollegeDAL.GetCollegeList(exp).OrderByDescending(r => r.CreateTime).ToGridResultSet(pageIndex, pageSize); return list; } } }