Esempio n. 1
0
        protected override Expression <Func <StockTransferDetail, bool> > GetExpression()
        {
            if (!string.IsNullOrWhiteSpace(Keyword))
            {
                ExpressionObj = x => x.Remarks.ToLower().Contains(Keyword);
            }

            if (!string.IsNullOrWhiteSpace(ParentId))
            {
                ExpressionObj = ExpressionObj.And(x => x.StockTransferId == ParentId);
            }

            if (ProductDetailId.IdIsOk())
            {
                ExpressionObj = ExpressionObj.And(x => x.ProductDetailId == ProductDetailId);
            }

            if (SourceWarehouseId.IdIsOk())
            {
                ExpressionObj = ExpressionObj.And(x => x.SourceWarehouseId == SourceWarehouseId);
            }

            if (DestinationWarehouseId.IdIsOk())
            {
                ExpressionObj = ExpressionObj.And(x => x.DestinationWarehouseId == DestinationWarehouseId);
            }

            ExpressionObj = ExpressionObj.And(x => x.ShopId == ShopId);
            ExpressionObj = ExpressionObj.And(GenerateBaseEntityExpression());
            return(ExpressionObj);
        }
Esempio n. 2
0
        protected override Expression <Func <StockTransfer, bool> > GetExpression()
        {
            if (!string.IsNullOrWhiteSpace(Keyword))
            {
                ExpressionObj = x =>
                                x.Remarks.ToLower().Contains(Keyword) || x.OrderNumber.ToString().ToLower().Contains(Keyword) ||
                                x.OrderReferenceNumber.ToString().ToLower().Contains(Keyword);
            }

            if (SourceWarehouseId.IdIsOk())
            {
                this.ExpressionObj = this.ExpressionObj.And(x => x.SourceWarehouseId == SourceWarehouseId);
            }

            if (DestinationWarehoueId.IdIsOk())
            {
                this.ExpressionObj = this.ExpressionObj.And(x => x.DestinationWarehouseId == DestinationWarehoueId);
            }

            ExpressionObj = ExpressionObj.And(x => x.ShopId == ShopId);
            ExpressionObj = ExpressionObj.And(GenerateBaseEntityExpression());
            return(ExpressionObj);
        }