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)));
        }
Exemple #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));
        }
Exemple #4
0
 public string ToLaTeX()
 {
     if (ToState.Equals(FromState))   //{${1}$} ({0})
     {
         return(string.Format("({0}) edge[out=80,in=100,loop] node[above]{1} ({0})", FromState,
                              "{$" + GetRule().Replace("_", "\\_") + "$}"));
     }
     return(string.Format("({0}) edge node[above]{1} ({2})", FromState, "{$" + GetRule().Replace("_", "\\_") + "$}", ToState));
 }
Exemple #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);
     }
 }