Example #1
0
        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);
        }
Example #3
0
        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);
            }
        }
Example #4
0
        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));
            }
        }
Example #5
0
        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));
            }
        }
Example #6
0
        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));
            }
        }
Example #7
0
 public Assignment Set(DecimalExpression value)
 {
     return(new Assignment(this, ((object)value) == null ? (IExpression)NullExpression.Value : value));
 }
Example #8
0
 internal OracleDecimalColumn(DecimalExpression expr, string columnName)
     : base(expr, columnName)
 {
 }