public ActionResult AddressList(ShippingAddressSearchModel model) { //获取当前物业小区 int CurrentPlaceId = GetSessionModel().PropertyPlaceId ?? 0; //查询条件 Expression <Func <T_AppUserShippingAddress, bool> > where = u => u.DelFlag == ConstantParam.DEL_FLAG_DEFAULT && u.User.UserPlaces.Any(up => up.PropertyPlaceId == CurrentPlaceId); //如果要查询默认地址 if (model.IsDefault == 1) { where = PredicateBuilder.And(where, u => u.IsDefault == 1); } //根据所属APP用户用户名模糊查询 if (!string.IsNullOrEmpty(model.Kword)) { where = PredicateBuilder.And(where, u => u.User.UserName.Contains(model.Kword)); } //排序 var sortModel = this.SettingSorting("Id", false); //获取用户收货地址分页数据 IAppUserShippingAddressBLL addressBll = BLLFactory <IAppUserShippingAddressBLL> .GetBLL("AppUserShippingAddressBLL"); model.ResultList = addressBll.GetPageList(where, sortModel.SortName, sortModel.IsAsc, model.PageIndex) as PagedList <T_AppUserShippingAddress>; model.IsDefaultList = GetIsDefaultList(); return(View(model)); }
public string Test([ModelBinder(typeof(ShippingAddressSearchModelBinder))] ShippingAddressSearchModel model) { return(model.ToString()); }