public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            if (obj == this)
            {
                return(true);
            }

            return(obj is InventoryAdjustment other &&
                   ((Id == null && other.Id == null) || (Id?.Equals(other.Id) == true)) &&
                   ((ReferenceId == null && other.ReferenceId == null) || (ReferenceId?.Equals(other.ReferenceId) == true)) &&
                   ((FromState == null && other.FromState == null) || (FromState?.Equals(other.FromState) == true)) &&
                   ((ToState == null && other.ToState == null) || (ToState?.Equals(other.ToState) == true)) &&
                   ((LocationId == null && other.LocationId == null) || (LocationId?.Equals(other.LocationId) == true)) &&
                   ((CatalogObjectId == null && other.CatalogObjectId == null) || (CatalogObjectId?.Equals(other.CatalogObjectId) == true)) &&
                   ((CatalogObjectType == null && other.CatalogObjectType == null) || (CatalogObjectType?.Equals(other.CatalogObjectType) == true)) &&
                   ((Quantity == null && other.Quantity == null) || (Quantity?.Equals(other.Quantity) == true)) &&
                   ((TotalPriceMoney == null && other.TotalPriceMoney == null) || (TotalPriceMoney?.Equals(other.TotalPriceMoney) == true)) &&
                   ((OccurredAt == null && other.OccurredAt == null) || (OccurredAt?.Equals(other.OccurredAt) == true)) &&
                   ((CreatedAt == null && other.CreatedAt == null) || (CreatedAt?.Equals(other.CreatedAt) == true)) &&
                   ((Source == null && other.Source == null) || (Source?.Equals(other.Source) == true)) &&
                   ((EmployeeId == null && other.EmployeeId == null) || (EmployeeId?.Equals(other.EmployeeId) == true)) &&
                   ((TransactionId == null && other.TransactionId == null) || (TransactionId?.Equals(other.TransactionId) == true)) &&
                   ((RefundId == null && other.RefundId == null) || (RefundId?.Equals(other.RefundId) == true)) &&
                   ((PurchaseOrderId == null && other.PurchaseOrderId == null) || (PurchaseOrderId?.Equals(other.PurchaseOrderId) == true)) &&
                   ((GoodsReceiptId == null && other.GoodsReceiptId == null) || (GoodsReceiptId?.Equals(other.GoodsReceiptId) == true)));
        }
Пример #2
0
        public int CompareTo(Transition <T> other)
        {
            int fromCompare   = FromState.Equals(other.FromState) ? 1 : 0;
            int symbolCompare = Symbol.CompareTo(other.Symbol);
            int toCompare     = ToState.Equals(other.ToState) ? 1 : 0;

            return(fromCompare != 0 ? fromCompare : (symbolCompare != 0 ? symbolCompare : toCompare));
        }
        /// <summary>
        /// Compares two <see cref="Transition{T}"/> objects.
        /// </summary>
        /// <param name="other">The <see cref="Transition{T}"/> to compare to.</param>
        /// <returns>An integer indicator. TODO: Need to check this one with Paul</returns>
        public int CompareTo(Transition <T> other)
        {
            int fromCompare = FromState.Equals(other.FromState) ? 1 : 0;
            int idCompare   = Identifier.CompareTo(other.Identifier);
            int toCompare   = ToState.Equals(other.ToState) ? 1 : 0;

            //And now, for some magic
            return(fromCompare != 0 ? fromCompare : (idCompare != 0 ? idCompare : toCompare));
        }
Пример #4
0
        public override bool Equals(object other)
        {
            Transition <T> transition = other as Transition <T>;

            if (transition != null)
            {
                return(FromState.Equals(transition.FromState) &&
                       ToState.Equals(transition.ToState) &&
                       Symbol == (transition.Symbol));
            }
            return(false);
        }
Пример #5
0
 public bool Equals(EdgeAction <T> other)
 {
     if (other == null)
     {
         return(false);
     }
     else
     {
         bool states_equal = FromState.Equals(other.FromState) && ToState.Equals(other.ToState);
         bool costs_equal  = Cost.Equals(other.Cost);
         return(states_equal && costs_equal);
     }
 }
Пример #6
0
 // overriding equals
 public override bool Equals(Object other)
 {
     if (other == null)
     {
         return(false);
     }
     else if (other is Transition <T> )
     {
         var otherCast = other as Transition <T>;
         return(FromState.Equals(otherCast.FromState) &&
                ToState.Equals(otherCast.ToState) &&
                Symbol.Equals(otherCast.Symbol));
     }
     else
     {
         return(false);
     }
 }