// 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); } }
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); }
// Alternative method for operator >= public static SqlBoolean GreaterThanOrEqual(SqlMoney x, SqlMoney y) { return(x >= y); }
// Alternative method for operator > public static SqlBoolean GreaterThan(SqlMoney x, SqlMoney y) { return(x > y); }
// Alternative method for operator <= public static SqlBoolean LessThanOrEqual(SqlMoney x, SqlMoney y) { return(x <= y); }
// Alternative method for operator != public static SqlBoolean NotEquals(SqlMoney x, SqlMoney y) { return(x != y); }
// Alternative method for operator < public static SqlBoolean LessThan(SqlMoney x, SqlMoney y) { return(x < y); }
// Alternative method for operator == public static SqlBoolean Equals(SqlMoney x, SqlMoney y) { return(x == y); }
// Alternative method for operator / public static SqlMoney Divide(SqlMoney x, SqlMoney y) { return(x / y); }
// Alternative method for operator * public static SqlMoney Multiply(SqlMoney x, SqlMoney y) { return(x * y); }
// Alternative method for operator - public static SqlMoney Subtract(SqlMoney x, SqlMoney y) { return(x - y); }
//-------------------------------------------------- // Alternative methods for overloaded operators //-------------------------------------------------- // Alternative method for operator + public static SqlMoney Add(SqlMoney x, SqlMoney y) { return(x + y); }