/// <summary> /// 获取小区列表 /// </summary> /// <param name="model">物业小区查询模型</param> /// <returns></returns> public PropertyPlaceSearchModel GetPlaceList(PropertyPlaceSearchModel model) { model.PlaceTypeList = GetPlaceTypeList(null); //查询条件 Expression <Func <T_PropertyPlace, bool> > where = u => u.DelFlag == ConstantParam.DEL_FLAG_DEFAULT; //如果查询的物业公司ID不为空 if (model.CompanyId != null) { where = PredicateBuilder.And(where, u => u.CompanyId == model.CompanyId); } if (model.PlaceType != null) { where = PredicateBuilder.And(where, u => u.PlaceType == model.PlaceType.Value); } if (!string.IsNullOrEmpty(model.PlaceName)) { where = PredicateBuilder.And(where, u => u.Name.Contains(model.PlaceName)); } //排序 var sortModel = this.SettingSorting("Id", false); //将查询到的数据赋值传到页面 IPropertyPlaceBLL placeBll = BLLFactory <IPropertyPlaceBLL> .GetBLL("PropertyPlaceBLL"); model.DataList = placeBll.GetPageList(where, sortModel.SortName, sortModel.IsAsc, model.PageIndex) as PagedList <T_PropertyPlace>; return(model); }
public ActionResult PropertyUserList(PropertyPlaceSearchModel model) { IPropertyUserBLL propertyUserBll = BLLFactory <IPropertyUserBLL> .GetBLL("PropertyUserBLL"); int propertyCompanyId = GetSessionModel().CompanyId.Value; Expression <Func <T_PropertyUser, bool> > where = u => (string.IsNullOrEmpty(model.Kword) ? true : (u.TrueName.Contains(model.Kword) || u.UserName.Contains(model.Kword))) && u.DelFlag == ConstantParam.DEL_FLAG_DEFAULT && u.PropertyPlace.CompanyId == propertyCompanyId; if (model.PropertyPlaceId != null) { where = PredicateBuilder.And(where, u => u.PropertyPlaceId == model.PropertyPlaceId.Value); } var sortModel = this.SettingSorting("Id", false); model.DataUserList = propertyUserBll.GetPageList(where, sortModel.SortName, sortModel.IsAsc, model.PageIndex) as PagedList <T_PropertyUser>; model.PropertyPlaceList = GetPropertyPlaceList(); return(View(model)); }
public ActionResult PlaceList(PropertyPlaceSearchModel model) { //赋值物业公司列表 model.CompanyList = GetCompanyList(); return(View(GetPlaceList(model))); }
public ActionResult PlaceList(PropertyPlaceSearchModel model) { model.CompanyId = GetSessionModel().CompanyId.Value; return(View(GetPlaceList(model))); }