예제 #1
0
        /// <summary>
        /// Determine if this CO equals another CO
        /// </summary>
        public bool Equals(CO other)
        {
            bool result = false;

            if (other != null)
            {
                result = base.Equals((QTY <Decimal?>)other) &&
                         (this.Code != null ? this.Code.Equals(other.Code) : (bool)(other.Code == null));
            }
            return(result);
        }
예제 #2
0
        /// <summary>
        /// Determine semantic equality to a coded simple
        /// </summary>
        public override BL SemanticEquals(IAny other)
        {
            if (other == null)
            {
                return(null);
            }
            else if (this.IsNull && other.IsNull)
            {
                return new BL()
                       {
                           NullFlavor = NullFlavorUtil.GetCommonParent(this.NullFlavor, other.NullFlavor)
                       }
            }
            ;
            else if (this.IsNull ^ other.IsNull)
            {
                return new BL()
                       {
                           NullFlavor = DataTypes.NullFlavor.NotApplicable
                       }
            }
            ;
            else if (other is CO)
            {
                CO otherCo = other as CO;

                if (this.Code == null || otherCo.Code == null)
                {
                    return(false);
                }
                return(this.Code.SemanticEquals(otherCo.Code));
            }
            else if (other is ICodedSimple && this.Code != null)
            {
                return(this.Code.SemanticEquals(other));
            }
            else
            {
                return(false);
            }
        }