示例#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);
            }
        }
示例#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);
        }
示例#3
0
 // Alternative method for operator >=
 public static SqlBoolean GreaterThanOrEqual(SqlMoney x, SqlMoney y)
 {
     return(x >= y);
 }
示例#4
0
 // Alternative method for operator >
 public static SqlBoolean GreaterThan(SqlMoney x, SqlMoney y)
 {
     return(x > y);
 }
示例#5
0
 // Alternative method for operator <=
 public static SqlBoolean LessThanOrEqual(SqlMoney x, SqlMoney y)
 {
     return(x <= y);
 }
示例#6
0
 // Alternative method for operator !=
 public static SqlBoolean NotEquals(SqlMoney x, SqlMoney y)
 {
     return(x != y);
 }
示例#7
0
 // Alternative method for operator <
 public static SqlBoolean LessThan(SqlMoney x, SqlMoney y)
 {
     return(x < y);
 }
示例#8
0
 // Alternative method for operator ==
 public static SqlBoolean Equals(SqlMoney x, SqlMoney y)
 {
     return(x == y);
 }
示例#9
0
 // Alternative method for operator /
 public static SqlMoney Divide(SqlMoney x, SqlMoney y)
 {
     return(x / y);
 }
示例#10
0
 // Alternative method for operator *
 public static SqlMoney Multiply(SqlMoney x, SqlMoney y)
 {
     return(x * y);
 }
示例#11
0
 // Alternative method for operator -
 public static SqlMoney Subtract(SqlMoney x, SqlMoney y)
 {
     return(x - y);
 }
示例#12
0
        //--------------------------------------------------
        // Alternative methods for overloaded operators
        //--------------------------------------------------

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