public Expression <Func <ResCurrentType, bool> > QuantityCollectionAnyLessThanOrEqualTo(int Id, decimal MidNumber, string System, string Code) { Setup(Id, 0, MidNumber, 0, System, Code); //Build Inner Expression if (SearchValueReferenceSystem.Value == null && SearchValueReferenceCode.Value == null) { Expression LessThanOrEqualToExpression = DecimalExpression.LessThanOrEqualToExpression(propertyReferenceComparator, propertyReferenceNumber, SearchValueReferenceMid); return(FinaliseExpression(LessThanOrEqualToExpression)); } else { Expression LessThanOrEqualToExpression = DecimalExpression.LessThanOrEqualToExpression(propertyReferenceComparator, propertyReferenceNumber, SearchValueReferenceMid); Expression SystemCodeOrUnit_EqualTo_Expression = QuantityExpression.SystemCodeOrUnit_EqualTo_Expression(propertyReferenceSystem, propertyReferenceCode, propertyReferenceUnit, SearchValueReferenceSystem, SearchValueReferenceCode); Expression Final_InnerExpression = Expression.AndAlso(LessThanOrEqualToExpression, SystemCodeOrUnit_EqualTo_Expression); return(FinaliseExpression(Final_InnerExpression)); } }
public Expression <Func <ResCurrentType, bool> > QuantityCollectionAnyEqualTo(int Id, decimal LowNumber, decimal MidNumber, decimal HighNumber, string System, string Code) { Setup(Id, LowNumber, MidNumber, HighNumber, System, Code); //Build Inner Expression //If the System & Code is null then only search on the value if (SearchValueReferenceSystem.Value == null && SearchValueReferenceCode.Value == null) { Expression EqualToExpression = DecimalExpression.EqualToExpression(propertyReferenceComparator, propertyReferenceNumber, SearchValueReferenceLow, SearchValueReferenceMid, SearchValueReferenceHigh); return(FinaliseExpression(EqualToExpression)); } else { //If only one of them system and code is null then search with them as null which will return notyhing Expression EqualToExpression = DecimalExpression.EqualToExpression(propertyReferenceComparator, propertyReferenceNumber, SearchValueReferenceLow, SearchValueReferenceMid, SearchValueReferenceHigh); Expression SystemCodeOrUnit_EqualTo_Expression = QuantityExpression.SystemCodeOrUnit_EqualTo_Expression(propertyReferenceSystem, propertyReferenceCode, propertyReferenceUnit, SearchValueReferenceSystem, SearchValueReferenceCode); Expression Final_InnerExpression = Expression.AndAlso(EqualToExpression, SystemCodeOrUnit_EqualTo_Expression); return(FinaliseExpression(Final_InnerExpression)); } }