public ActionResult NoticeList(NewsNoticeSearchModel model) { IPostBLL postBll = BLLFactory <IPostBLL> .GetBLL("PostBLL"); int propertyPlaceId = GetSessionModel().PropertyPlaceId.Value; Expression <Func <T_Post, bool> > where = u => u.PropertyPlaceId == propertyPlaceId && u.DelFlag == ConstantParam.DEL_FLAG_DEFAULT && (string.IsNullOrEmpty(model.Title) ? true : u.Title.Contains(model.Title)) && (model.PublishedFlag == null ? true : u.PublishedFlag == model.PublishedFlag.Value); //排序 var sortModel = this.SettingSorting("Id", false); model.PostList = postBll.GetPageList(where, sortModel.SortName, sortModel.IsAsc, model.PageIndex) as PagedList <T_Post>; model.StatueList = getStatueList(); return(View(model)); }
public ActionResult CompanyNewNoticeList(NewsNoticeSearchModel model) { IPostBLL postBll = BLLFactory <IPostBLL> .GetBLL("PostBLL"); int propertyCompanyId = GetSessionModel().CompanyId.Value; Expression <Func <T_Post, bool> > where = u => u.PropertyPlace.CompanyId == propertyCompanyId && u.DelFlag == ConstantParam.DEL_FLAG_DEFAULT && (string.IsNullOrEmpty(model.Title) ? true : u.Title.Contains(model.Title)) && (u.PublishedFlag == Property.Common.ConstantParam.PUBLISHED_TRUE); if (model.PropertyPlaceId != null) { where = PredicateBuilder.And(where, u => u.PropertyPlaceId == model.PropertyPlaceId.Value); } var sortModel = this.SettingSorting("Id", false); model.PostList = postBll.GetPageList(where, sortModel.SortName, sortModel.IsAsc, model.PageIndex) as PagedList <T_Post>; model.PropertyPlaceList = GetPropertyPlaceList(); return(View(model)); }