コード例 #1
0
        public override Specification <Mapping> GetSpecification()
        {
            var spec = new Specification <Mapping>();

            if (!Ids.IsEmpty())
            {
                int[] ids = ArrayHelpers.StringToIntArray(Ids);
                if (ids != null && ids.Length > 0)
                {
                    spec.And(c => ids.Contains(c.Id));
                }
            }
            if (!ProductIds.IsEmpty())
            {
                int[] ids = ArrayHelpers.StringToIntArray(ProductIds);
                if (ids != null && ids.Length > 0)
                {
                    spec.And(c => ids.Contains(c.ProductId));
                }
            }
            if (StoreId.HasValue)
            {
                spec.And(m => m.StoreId.Equals(StoreId.Value));
            }
            if (!Sku.IsEmpty())
            {
                spec.And(m => m.Product.Sku.StartsWith(Sku));
            }
            if (!StoreSku.IsEmpty())
            {
                spec.And(m => m.StoreSku.StartsWith(StoreSku));
            }
            return(spec);
        }
コード例 #2
0
ファイル: ProductFilter.cs プロジェクト: sweeperq/Monona
        public override Specification <Product> GetSpecification()
        {
            var spec = new Specification <Product>();

            if (!Ids.IsEmpty())
            {
                int[] ids = ArrayHelpers.StringToIntArray(Ids);
                if (ids != null && ids.Length > 0)
                {
                    spec.And(c => ids.Contains(c.Id));
                }
            }
            if (VendorId.HasValue)
            {
                spec.And(c => c.VendorId == VendorId.Value);
            }
            if (!Sku.IsEmpty())
            {
                spec.And(c => c.Sku.StartsWith(Sku));
            }
            if (!Name.IsEmpty())
            {
                spec.And(c => c.Name.StartsWith(Name));
            }
            if (!WarehouseLocation.IsEmpty())
            {
                spec.And(c => c.WarehouseLocation.StartsWith(WarehouseLocation) || c.BulkWarehouseLocation.StartsWith(WarehouseLocation));
            }
            if (!ShowAll)
            {
                spec.And(c => !c.Discontinued || c.Inventory.StockQuantity > 0);
            }
            return(spec);
        }
コード例 #3
0
        public override Specification <ReportGroupItem> GetSpecification()
        {
            var spec = new Specification <ReportGroupItem>();

            if (!Ids.IsEmpty())
            {
                int[] ids = ArrayHelpers.StringToIntArray(Ids);
                if (ids != null && ids.Length > 0)
                {
                    spec.And(c => ids.Contains(c.Id));
                }
            }
            if (ReportGroupId.HasValue)
            {
                spec.And(i => i.ReportGroupId == ReportGroupId.Value);
            }
            if (!Sku.IsEmpty())
            {
                spec.And(i => i.Product.Sku.StartsWith(Sku));
            }
            if (!Name.IsEmpty())
            {
                spec.And(i => i.Product.Name.Contains(Name));
            }
            return(spec);
        }
コード例 #4
0
        public override Specification <Adjustment> GetSpecification()
        {
            var spec = new Specification <Adjustment>();

            if (!Ids.IsEmpty())
            {
                int[] ids = ArrayHelpers.StringToIntArray(Ids);
                if (ids != null && ids.Length > 0)
                {
                    spec.And(c => ids.Contains(c.Id));
                }
            }

            if (!ProductIds.IsEmpty())
            {
                int[] ids = ArrayHelpers.StringToIntArray(ProductIds);
                if (ids != null && ids.Length > 0)
                {
                    spec.And(c => ids.Contains(c.ProductId));
                }
            }

            if (AdjustmentTypeId.HasValue)
            {
                spec.And(a => a.AdjustmentTypeId == AdjustmentTypeId.Value);
            }
            if (StoreId.HasValue)
            {
                spec.And(a => a.StoreId == StoreId.Value);
            }
            if (!Sku.IsEmpty())
            {
                spec.And(r => r.Product.Sku.StartsWith(Sku));
            }
            if (!ReferenceNumber.IsEmpty())
            {
                spec.And(r => r.ReferenceNumber.StartsWith(ReferenceNumber));
            }
            return(spec);
        }
コード例 #5
0
        public override Specification <Reservation> GetSpecification()
        {
            var spec = new Specification <Reservation>();

            if (!Ids.IsEmpty())
            {
                int[] ids = ArrayHelpers.StringToIntArray(Ids);
                if (ids != null && ids.Length > 0)
                {
                    spec.And(c => ids.Contains(c.Id));
                }
            }

            if (!ProductIds.IsEmpty())
            {
                int[] ids = ArrayHelpers.StringToIntArray(ProductIds);
                if (ids != null && ids.Length > 0)
                {
                    spec.And(c => ids.Contains(c.ProductId));
                }
            }

            if (!OrderNumber.IsEmpty())
            {
                spec.And(r => r.OrderNumber == OrderNumber);
            }
            if (!Sku.IsEmpty())
            {
                spec.And(r => r.Product.Sku.StartsWith(Sku));
            }
            if (!ShowAll)
            {
                spec.And(r => r.Quantity > 0);
            }
            return(spec);
        }