public ActionResult BuildCompanyList(BuildCompanyModel model) { //物业公司Id int CompanyId = GetSessionModel().CompanyId.Value; IBuildCompanyBLL buildCompanyBll = BLLFactory <IBuildCompanyBLL> .GetBLL("BuildCompanyBLL"); //查询 Expression <Func <T_BuildCompany, bool> > where = u => (string.IsNullOrEmpty(model.Name) ? true : u.Name.Contains(model.Name)) && u.DelFlag == ConstantParam.DEL_FLAG_DEFAULT && u.PropertyPlace.CompanyId == CompanyId && u.PropertyPlace.PlaceType == ConstantParam.PLACE_TYPE_COMPANY; //根据小区名称查询 if (model.PropertyPlaceId != null) { where = PredicateBuilder.And(where, u => u.PropertyPlaceId == model.PropertyPlaceId.Value); } //排序 var sortModel = this.SettingSorting("Id", false); model.DataList = buildCompanyBll.GetPageList(where, sortModel.SortName, sortModel.IsAsc, model.PageIndex) as PagedList <T_BuildCompany>; //获取所有物业小区列表 model.CompanyPlaceList = GetCompanyPlaceList(); return(View(model)); }
public ActionResult BuildCompanyList(BuildCompanyModel model) { IBuildCompanyBLL buildCompanyBll = BLLFactory <IBuildCompanyBLL> .GetBLL("BuildCompanyBLL"); int propertyPlaceId = GetSessionModel().PropertyPlaceId.Value; //查询 Expression <Func <T_BuildCompany, bool> > where = u => (string.IsNullOrEmpty(model.Name) ? true : u.Name.Contains(model.Name)) && u.DelFlag == Property.Common.ConstantParam.DEL_FLAG_DEFAULT && u.PropertyPlaceId == propertyPlaceId; //排序 var sortModel = this.SettingSorting("Id", false); var list = buildCompanyBll.GetPageList(where, sortModel.SortName, sortModel.IsAsc, model.PageIndex); return(View(list)); }