internal virtual StringBuilder GetAutoPropertyFilterString() { var res = new StringBuilder(); if (string.IsNullOrEmpty(TariffCodeFilter) == false) { res.Append(" && " + string.Format("TariffCode.Contains(\"{0}\")", TariffCodeFilter)); } if (QuantityFilter.HasValue) { res.Append(" && " + string.Format("Quantity == {0}", QuantityFilter.ToString())); } if (TotalFilter.HasValue) { res.Append(" && " + string.Format("Total == {0}", TotalFilter.ToString())); } if (string.IsNullOrEmpty(TariffCodeDescriptionFilter) == false) { res.Append(" && " + string.Format("TariffCodeDescription.Contains(\"{0}\")", TariffCodeDescriptionFilter)); } return(res.ToString().StartsWith(" &&") || res.Length == 0 ? res: res.Insert(0, " && ")); }
internal virtual StringBuilder GetAutoPropertyFilterString() { var res = new StringBuilder(); if (string.IsNullOrEmpty(ItemNumberFilter) == false) { res.Append(" && " + string.Format("ItemNumber.Contains(\"{0}\")", ItemNumberFilter)); } if (string.IsNullOrEmpty(ItemDescriptionFilter) == false) { res.Append(" && " + string.Format("ItemDescription.Contains(\"{0}\")", ItemDescriptionFilter)); } if (QuantityFilter.HasValue) { res.Append(" && " + string.Format("Quantity == {0}", QuantityFilter.ToString())); } if (QtyAllocatedFilter.HasValue) { res.Append(" && " + string.Format("QtyAllocated == {0}", QtyAllocatedFilter.ToString())); } return(res.ToString().StartsWith(" &&") || res.Length == 0 ? res: res.Insert(0, " && ")); }
public IEnumerable <Inventory> GetByQuantityLevel(QuantityFilter filter) { try { var context = new InventoryContext(); var result = (filter switch { QuantityFilter.Highest => GetInventoryByMaxQuantity(context), QuantityFilter.Lowest => GetInventoryByMinQuantity(context), _ => throw new NotImplementedException() }).ToList(); Log.Info($"Get quantity => {filter} returned {result.ToList().Count} result(s)."); return(result); }
public Task <IEnumerable <Inventory> > GetByQuantityLevel(QuantityFilter filter) { return(Task.FromResult(_dataService.GetByQuantityLevel(filter))); }
public void Apply(QuantityFilter filter) => _query = _query.Where($"EXISTS(SELECT epc.event_id FROM epcis.epc epc WHERE epc.type = {EpcType.Quantity} AND epc.quantity {filter.Operator.ToSql()} {_parameters.Add(filter.Value)} AND epc.event_id = event.id)");
internal virtual StringBuilder GetAutoPropertyFilterString() { var res = new StringBuilder(); if (string.IsNullOrEmpty(EntryDataIdFilter) == false) { res.Append(" && " + string.Format("EntryDataId.Contains(\"{0}\")", EntryDataIdFilter)); } if (LineNumberFilter.HasValue) { res.Append(" && " + string.Format("LineNumber == {0}", LineNumberFilter.ToString())); } if (string.IsNullOrEmpty(ItemNumberFilter) == false) { res.Append(" && " + string.Format("ItemNumber.Contains(\"{0}\")", ItemNumberFilter)); } if (QuantityFilter.HasValue) { res.Append(" && " + string.Format("Quantity == {0}", QuantityFilter.ToString())); } if (string.IsNullOrEmpty(UnitsFilter) == false) { res.Append(" && " + string.Format("Units.Contains(\"{0}\")", UnitsFilter)); } if (string.IsNullOrEmpty(ItemDescriptionFilter) == false) { res.Append(" && " + string.Format("ItemDescription.Contains(\"{0}\")", ItemDescriptionFilter)); } if (CostFilter.HasValue) { res.Append(" && " + string.Format("Cost == {0}", CostFilter.ToString())); } if (QtyAllocatedFilter.HasValue) { res.Append(" && " + string.Format("QtyAllocated == {0}", QtyAllocatedFilter.ToString())); } if (UnitWeightFilter.HasValue) { res.Append(" && " + string.Format("UnitWeight == {0}", UnitWeightFilter.ToString())); } if (DoNotAllocateFilter.HasValue) { res.Append(" && " + string.Format("DoNotAllocate == {0}", DoNotAllocateFilter)); } if (string.IsNullOrEmpty(TariffCodeFilter) == false) { res.Append(" && " + string.Format("TariffCode.Contains(\"{0}\")", TariffCodeFilter)); } if (string.IsNullOrEmpty(CNumberFilter) == false) { res.Append(" && " + string.Format("CNumber.Contains(\"{0}\")", CNumberFilter)); } if (CLineNumberFilter.HasValue) { res.Append(" && " + string.Format("CLineNumber == {0}", CLineNumberFilter.ToString())); } if (DownloadedFilter.HasValue) { res.Append(" && " + string.Format("Downloaded == {0}", DownloadedFilter)); } if (string.IsNullOrEmpty(DutyFreePaidFilter) == false) { res.Append(" && " + string.Format("DutyFreePaid.Contains(\"{0}\")", DutyFreePaidFilter)); } if (TotalFilter.HasValue) { res.Append(" && " + string.Format("Total == {0}", TotalFilter.ToString())); } return(res.ToString().StartsWith(" &&") || res.Length == 0 ? res: res.Insert(0, " && ")); }
public void Apply(QuantityFilter filter) => _filters.AddCondition(QueryFilters.Epcs, $"type = {EpcType.Quantity.Id} AND quantity {filter.Operator.ToSql()} {_parameters.Add(filter.Value)}");