public void ToStringExpressionShouldConvertDecimalExpressionToStringExpression() { var decimalExpression = new DecimalExpression("2.5"); var result = _converter.ToStringExpression(decimalExpression); Assert.IsInstanceOfType(result, typeof(StringExpression)); Assert.AreEqual("2,5", result.Compile().Result); }
public void ToStringExpressionShouldConvertDecimalExpressionToStringExpression() { var decimalExpression = new DecimalExpression("2.5"); var result = _converter.ToStringExpression(decimalExpression); Assert.IsInstanceOfType(result, typeof(StringExpression)); Assert.AreEqual($"2{CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator}5", result.Compile().Result); }
internal DecimalColumn(DecimalExpression expr, string columnName) : this(columnName) { if (ReferenceEquals(expr, null)) { throw new ArgumentNullException("expr"); } Sql = expr.Sql; if (expr.ChildExpressions != null) { ChildExpressions.AddRange(expr.ChildExpressions); } }
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> > QuantityCollectionAllNotEqualTo(int Id, decimal LowNumber, decimal MidNumber, decimal HighNumber, string System, string Code) { Setup(Id, LowNumber, MidNumber, HighNumber, System, Code); //Build Inner Expression //Non of the values are equal to. if (SearchValueReferenceSystem.Value == null && SearchValueReferenceCode.Value == null) { Expression NotEqualToExpression = DecimalExpression.NotEqualToExpression(propertyReferenceComparator, propertyReferenceNumber, SearchValueReferenceLow, SearchValueReferenceMid, SearchValueReferenceHigh); return(FinaliseExpression(NotEqualToExpression)); } else { Expression NotEqualToExpression = DecimalExpression.NotEqualToExpression(propertyReferenceComparator, propertyReferenceNumber, SearchValueReferenceLow, SearchValueReferenceMid, SearchValueReferenceHigh); Expression SystemCodeOrUnit_NotEqualTo_Expression = QuantityExpression.SystemCodeOrUnit_NotEqualTo_Expression(propertyReferenceSystem, propertyReferenceCode, propertyReferenceUnit, SearchValueReferenceSystem, SearchValueReferenceCode); Expression Final_InnerExpression = Expression.OrElse(NotEqualToExpression, SystemCodeOrUnit_NotEqualTo_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)); } }
public Assignment Set(DecimalExpression value) { return(new Assignment(this, ((object)value) == null ? (IExpression)NullExpression.Value : value)); }
internal OracleDecimalColumn(DecimalExpression expr, string columnName) : base(expr, columnName) { }