Esempio n. 1
0
        // Compares this instance with a specified object
        /// <devdoc>
        ///    <para>[To be supplied.]</para>
        /// </devdoc>
        public override bool Equals(Object value)
        {
            if (!(value is SqlMoney))
            {
                return(false);
            }

            SqlMoney i = (SqlMoney)value;

            if (i.IsNull || IsNull)
            {
                return(i.IsNull && IsNull);
            }
            else
            {
                return((this == i).Value);
            }
        }
Esempio n. 2
0
        public int CompareTo(SqlMoney value)
        {
            // If both Null, consider them equal.
            // Otherwise, Null is less than anything.
            if (IsNull)
            {
                return(value.IsNull ? 0 : -1);
            }
            else if (value.IsNull)
            {
                return(1);
            }

            if (this < value)
            {
                return(-1);
            }
            if (this > value)
            {
                return(1);
            }
            return(0);
        }
Esempio n. 3
0
 // Alternative method for operator >=
 public static SqlBoolean GreaterThanOrEqual(SqlMoney x, SqlMoney y)
 {
     return(x >= y);
 }
Esempio n. 4
0
 // Alternative method for operator >
 public static SqlBoolean GreaterThan(SqlMoney x, SqlMoney y)
 {
     return(x > y);
 }
Esempio n. 5
0
 // Alternative method for operator <=
 public static SqlBoolean LessThanOrEqual(SqlMoney x, SqlMoney y)
 {
     return(x <= y);
 }
Esempio n. 6
0
 // Alternative method for operator !=
 public static SqlBoolean NotEquals(SqlMoney x, SqlMoney y)
 {
     return(x != y);
 }
Esempio n. 7
0
 // Alternative method for operator <
 public static SqlBoolean LessThan(SqlMoney x, SqlMoney y)
 {
     return(x < y);
 }
Esempio n. 8
0
 // Alternative method for operator ==
 public static SqlBoolean Equals(SqlMoney x, SqlMoney y)
 {
     return(x == y);
 }
Esempio n. 9
0
 // Alternative method for operator /
 public static SqlMoney Divide(SqlMoney x, SqlMoney y)
 {
     return(x / y);
 }
Esempio n. 10
0
 // Alternative method for operator *
 public static SqlMoney Multiply(SqlMoney x, SqlMoney y)
 {
     return(x * y);
 }
Esempio n. 11
0
 // Alternative method for operator -
 public static SqlMoney Subtract(SqlMoney x, SqlMoney y)
 {
     return(x - y);
 }
Esempio n. 12
0
        //--------------------------------------------------
        // Alternative methods for overloaded operators
        //--------------------------------------------------

        // Alternative method for operator +
        public static SqlMoney Add(SqlMoney x, SqlMoney y)
        {
            return(x + y);
        }