Exemplo n.º 1
0
        public ActionResult UserList(SearchModel model)
        {
            IPropertyUserBLL propertyUserBll = BLLFactory <IPropertyUserBLL> .GetBLL("PropertyUserBLL");

            int propertyPlaceId = GetSessionModel().PropertyPlaceId.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.PropertyPlaceId == propertyPlaceId;

            //排序
            var sortModel = this.SettingSorting("Id", false);
            var list      = propertyUserBll.GetPageList(where, sortModel.SortName, sortModel.IsAsc, model.PageIndex);

            return(View(list));
        }
Exemplo n.º 2
0
        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));
        }