示例#1
0
        private IQueryable <QuantityUnitDto> GetDetail(QuantityUnitSearchModel searchModel)
        {
            IQueryable <QuantityUnitDto> list = null;

            if (!searchModel.HasAnyValue())
            {
                list = _quantityUnitService.GetAll();
            }
            else
            {
                var predicate = PredicateBuilder.True <QuantityUnitDto>();

                if (!searchModel.UnitName.IsNull())
                {
                    predicate = predicate.And(c => c.UnitName.Contains(searchModel.UnitName));
                }

                list = _quantityUnitService.GetAll().AsExpandable().Where(predicate);
            }

            return(list);
        }
示例#2
0
        public virtual ActionResult GetDetails([DataSourceRequest] DataSourceRequest request, QuantityUnitSearchModel searchModel)
        {
            var list = GetDetail(searchModel);

            return(Json(list.ToDataSourceResult(request), JsonRequestBehavior.AllowGet));
        }